• Hello,

    I have tried adding a Facebook “Like” button to my blog posts by insterting this code into the single.php file:

    <iframe src=”http://www.facebook.com/plugins/like.php?href=&lt;?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:450px; height:60px”></iframe>

    However, it only adds the Like button to the permalink. How do I get the Like button to appear on all of the posts on my blog page?

    Basically, I would like all 10 of the posts on my blog page to have the Facebook Like button visible on each post all at once, without having to go to the permalinks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Single.php is the template file for single blog posts. You’ll need to add that code to your index.php file. Index.php is most likely where the theme loops through all of the blog posts and displays them on your homepage.

    there a plugin to have a button Facebook Like Button

    Yup there is. I don’t have a recommendation since I haven’t used one. How about a link to one you like @govpatel.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding Facebook "Like" Button to blog post’ is closed to new replies.