Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   HOWTO: add a facebook 'Like' button (http://forum.bytesforall.com/showthread.php?t=12115)

Tim F Jan 9, 2011 03:37 AM

HOWTO: add a facebook 'Like' button
 
Hey all,

I've got plenty of help here so wanted to give something back even if it's pretty small ;)

The following code can be added anywhere you want, but I add it to style & edit center column. It displays a facebook like button on your page using the iframe version of the code, but with the benefit that the like button will add the 'like' to the current page url rather than a single url.

In english, you get one of the features of the more complex version of the facebook like button without having to sign up for an account and use their java sdk etc.

Here it is:

Code:

<?php $Path=$_SERVER['REQUEST_URI']; $URI='http://www.yoursite.com'.$Path; ?>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $URI; ?>&layout=button_count&show_faces=false&width=450&action=like&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>

You need to replace http://www.yoursite.com with your sites root url in exactly the same format.

derekwbeck Jan 15, 2011 02:29 AM

Alternative View: you should set the url to either your home top-level domain (for all pages) or your facebook fan page if you have one. This way, you can collect fans in one place. If you have likes to each URL of your page, you are watering down your fan base. Some people will like one post, others will like another, and thus you'll have 5 unique likes for post A, 12 for post B, rather than 17 total for your site. My opinion: only like the site, not individual posts. Wordpress.org follows my approach: see their like count at the botton of any page on their site, and note the count is the same regardless of what page you look at on wordpress.org.

Derek Beck
http://www.1775thebook.com

Tim F Jan 16, 2011 06:51 AM

I would rather people find my best pages than always land on my home page, but both approaches are valid I think :)

Wyro Jan 21, 2011 06:10 PM

Tim, where do you insert that code? Thank you co much!

Steve Wyro

Tim F Jan 29, 2011 06:00 AM

On my site, I put it under Style and edit center column>The Loop, just before the
Code:

<!-- / Post -->
tag. But the beauty of atahualpa is that there's lots of places you could use it!


All times are GMT -6. The time now is 12:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.