Support » Plugin: FaceBook Like Button Plugin for WordPress » FBLike Shortcode

  • In case anyone wants to put this like button on only specific pages, here is a simple way to add a shortcode for this plugin.

    Add this code into your theme’s functions file.

    function wm_fblike_shortcode(){
    	$button = null;
    		$fblike_uri = get_permalink(get_the_ID());
    		$button = fblike_get_iframe($fblike_uri);
    	return ($button);

    Then, you can use the shortcode [fblike] in any post, page, or custom post type. If you’d like to use it in your template files, insert the following code into your template where you’d like to see the button.

    <?php echo do_shortcode('[fblike]');?>

    One usage note: if you’re using the shortcode or template tag, you’ll have to select the appropriate combination of “FBLikeButton Settings” on the plugin settings page to avoid showing the button more than once on your page.

  • The topic ‘FBLike Shortcode’ is closed to new replies.