Integrating Facebook With WordPress
Despite Facebook being the most successful of all of the social media sites, I’ve never made WPShout a presence on the site or attempted to integrate Facebook onto WPShout in any way. I tend to view Facebook as more personal and other sites such as Twitter more appropriate for both marketing the site and interacting with the people who read it.
However, that doesn’t mean that you can’t or shouldn’t integrate Facebook with WordPress. This post will attempt to outline the various ways you can integrate the two in question and answer format.
Which are the best Facebook plugins?
Is an excellent question and one which over the course of this post I shall attempt to answer. Regular Shout readers will know, though, that I’m a strong advocate of doing a little bit of coding and not using a plugin for everything, a trend I shall follow in this post.
How can I add a Like button to posts?
Facebook has a series of “social plugins” which are an excellent place to start for all sorts of little code snippets — and this includes Like buttons.
Their website explains it much better, but the basic embed is:
<iframe src="http://www.facebook.com/plugins/like.php?href=YOUR_URL"scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>
But of course, manually changing your URL isn’t practical, so replacing YOUR_URL with
<?php the_permalink(); ?> will automatically add the current post’s link:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php the_permalink(); ?>"scrolling="no" frameborder="0" style="border:none; width:450px; height:80px"></iframe>
There are, of course, an endless number of plugins which will do the same job for you. If you’re after one of the aforementioned plugins, Like seems to be a solid option.
How can I let users comment with their Facebook profiles?
Excellent question! There are quite a few neat little plugins which will do this for you. Facebook Comments for WordPress looks like an impressively comprehensive choice. Whilst this is never something I’d do on Shout, I will admit it could be quite handy to let your visitors comment with their Facebook profiles to save them filling out the Name, URL and email every time they visit your site (although a lot of visitors will have this saved with their browser, so don’t use it for that reason alone!).
How can I embed content from Facebook into posts?
The trend of oh, there’s a plugin for that continues here, with the Embed Facebook plugin providing this function.
The plugin literally takes any link to a public page, album or whatever and embeds the content into your post — the plugin’s site has the picture below showing you how to use it:
This could get a bit annoying — personally I would have preferred a shortcode so if I wanted to link to something on Facebook without embedding it I could.
How do I get a widget like box?
Ah, the old “like box” in convenient widget format that everyone has!
This is another case of get the plugin cause it’s vastly more convenient. I’m sure there are ways of doing it manually, but in this case, the plugin is just so much easier. Facebook Fan Box seems to be the one to go for here.
How can I automatically post to Facebook?
There are all sorts of plugins that’ll do this for you and they’re not very interesting so you can just read them in convenient list based format on this handy website.
How do I…
And that concludes today’s post. If you want to know how to do other exciting things, comment and I’ll see what I can do!
Enjoyed that? Join the email list!
You'll get a free e-book, and a year of free hosting from InMotion!