[resolved] Facebook like buttons for posts (without a plugin) (2 posts)

  1. ggg377
    Posted 2 years ago #

    Hi. I've been googling and I can't find a way to hardcode facebook likes into my single.php loop. It looks like they changed the formula for the like button, which definitely used to work. I succeeded in integrating twitter with my site in such a way. To my knowledge, the default code that facebook distributes from their site only works on actual sites not posts. I can't believe every single WP user out there is using the facebook plugin to have like buttons on their posts.

    Thank you for your answers :)

  2. ggg377
    Posted 2 years ago #

    I figured it out.

    The old code that Facebook used still works. I don't think it's even possible to get this from facebook's dev site.

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

Topic Closed

This topic has been closed to new replies.

About this Topic