WP LOGBOOK

Little adventures building sites with Wordpress…

Brandon & Geekosystem saves my day with Facebook Like how to

leave a comment »

Adding Facebook Like to Your Blog from Brandon Setter on Vimeo.

How to add the new Facebook “like” button on your blog or website. Tutorial includes HTML code and CSS.

Use this iframe in WordPress, notice the php coding:
<iframe src="http://www.facebook.com/plugins/like.php?href=&lt;?php echo rawurlencode(get_permalink()); ?>&layout=standard&show-faces=true&width=450&action=like&font=arial&colorscheme=light"
scrolling="no" frameborder="0" allowTransparency="true" id="facebook-like"></iframe>

And now the CSS tweak:
iframe#facebook-like { border:none; overflow:hidden; width:450px; margin: 0 0 -100px 0; padding: 0; }

Best to insert into The Loop and in single.php file if you want users to like your posts.

Update on updates from Geekosystem blog post that a universal method is discovered which can be used:
<?php echo rawurlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?>

Advertisements

Written by Yahya Ayob

April 24, 2010 at 11:26 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: