Title: FBLike Shortcode
Last modified: August 20, 2016

---

# FBLike Shortcode

 *  [Aaron Brown](https://wordpress.org/support/users/web-malama/)
 * (@web-malama)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/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;
   
       	if(function_exists('fblike_get_iframe')){
   
       		$fblike_uri = get_permalink(get_the_ID());
   
       		$button = fblike_get_iframe($fblike_uri);
   
       	}
   
       	return ($button);
   
       }
       add_shortcode('fblike','wm_fblike_shortcode');
       ```
   
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/fblikebutton.svg)
 * [FaceBook Like Button Plugin for Wordpress](https://wordpress.org/plugins/fblikebutton/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/fblikebutton/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/fblikebutton/)
 * [Active Topics](https://wordpress.org/support/plugin/fblikebutton/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fblikebutton/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fblikebutton/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Aaron Brown](https://wordpress.org/support/users/web-malama/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/fblike-shortcode/)
 * Status: not a support question