This topic has 9 replies, 4 voices, and was last updated 8 years by Radu.

  • Author
  • #107995
     DeniTT
    Participant

    Hi, is there a way built in FB login/register button can be put as a shorthcode on homepage? I dont want the rest form fields, just the FB button.

    If no current pre built option available, could you please assist with some code snippets to add it?

     

    Regards

    #108058
     Radu
    Moderator

    Hi,

    Please add this snippet to your wp-content/themes/kleo-child/functions.php

    COPY CODE
    
    
    if (!function_exists('kleo_fb_button_shortcode')) :
    	function kleo_fb_button_shortcode()
    	{
    		$output = '';
    		if ( sq_option( 'facebook_login', 0 ) == 1 && get_option( 'users_can_register' ) && !is_user_logged_in() ) {
    			$output .= '<a href="#" class="kleo-facebook-connect btn btn-default "><i class="icon-facebook"></i>   ' . __("Log in with Facebook", 'kleo_framework') . '</a>';
    		}
    		return $output;
    	}
    	add_shortcode('kleo_fb_button', 'kleo_fb_button_shortcode');
    endif;
    
    

    Then add in what page do you want homepage or any page this shortcode

    [kleo_fb_button]

    Of course this will be displayed only for logged out users.

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #108120
     DeniTT
    Participant

    This works great, thank you very much!

    #108314
     Radu
    Moderator

    You’re welcome

    Don’t forget to rate our theme 5 stars on Themeforest since it will really help us.

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #115452
     andrea_pg
    Participant

    hi, i need the same but not works with sweetdate theme, i added code in wp-content/themes/sweetdate-child/functions.php and [kleo_fb_button] in home page. please could you help me?

    #115646
     Radu
    Moderator

    Hi,

    The snippet is for Kleo theme not for sweet

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #115665
     andrea_pg
    Participant

    hi, tx for reply, i need to create the facebook button login in sweet, you advice me to create a new ticket?

    #115771
     Radu
    Moderator

    YEs it will be better

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #121789
     shaanbahra
    Participant

    Hello,

    I created the FB app… it s live and works fine as on developer.facebook.
    BUT when i put the app ID in the Misc and save it disappears and thus the FB button is also not visible!
    How to fix this?

    #121897
     Radu
    Moderator

    Hi,


    @shaanbahra

    Please add this code to wp-content/themes/kleo-child/functions.php

    COPY CODE
    
    add_filter( 'kleo_theme_options_ajax', '__return_false' );
    

    Note : child theme needs to be installed and active

    Then change some settings in theme options and press save and check if the changes applies

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?