WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Facebook LIKE button on home page posts (4 posts)

  1. rabramson
    Member
    Posted 4 years ago #

    Hello,

    I recently added this code to my single.php template to bring up the Facebook LIKE button and counter:

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

    It worked great on the post pages (ex: http://www.rocktorch.com/2010/05/06/rachel-flotard-of-visqueen-carries-a-torch-for-dave-grohl/)

    But the Like button does not appear on the posts that appear on my homepage (http://rocktorch.com)

    Do I need to alter a separate template to make this button appear on homepage posts?

    Thanks,

    Randy

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Yes you do. Try adding it to index.php.

  3. rabramson
    Member
    Posted 4 years ago #

    that did it! thanks!

  4. bottomlessinc
    Member
    Posted 4 years ago #

    @rabramson

    You could just use this plugin: http://wordpress.org/extend/plugins/like/

    It will take care of everything for you, even your open graph meta tags.
    And you can configure it to show on home/posts/archives/search.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags