Author welshy
2007
5
Premium
Rank 6624

Embed Facebook Into Wordpress

So today I came across a cool method on embedding Facebook content within a wordpress blog post or page.

Credit goes out to Amit Agarwal who I've been following for a few years now: http://www.labnol.org/internet/embed-facebook-post/28151/

If you've watched the short video and ready to try this on your own blog.
Here is the link to the code you need to copy: http://d.pr/n/1oMh

<div id="fb-root"></div><script>(function(d, s, id) {    var js, fjs = d.getElementsByTagName(s)[0];    if (d.getElementById(id))        return;    js = d.createElement(s);    js.id = id;    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";    fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script><fb:post href="FB_TIME_STAMP_URL_HERE"></fb:post><br>

Remember that you need to replace FB_TIME_STAMP_URL_HERE with the Facebook post URL or time stamp URL as seen in image below:

If you're having trouble getting this to work, odds are it's because you switched over to visual mode. Switching over to visual mode causes wordpress to alter the code.

If this helped please hit the like button because that helps me too.

Join the Discussion
Write something…
Recent messages
iamrobert Premium
What an excellent training, you kept it really simple,
thank-you
Robert
Reply
Chris Lee Premium
Awesome man! :) Thanks for sharing! :))
Reply
christopherM Premium
Thanks Welshy. I follow Amit too he has some really good stuff. But I couldn't figure out how to do this the way he explained it. You made it much easier for me. Thanks
Reply
welshy Premium
Yes Amit uses a program called Putty and didn't cover how to for us none techy people.
Reply
nathaniell Premium
Thanks for the tutorial Craig. I heard about this but hadn't looked into it.

It's super annoying that with some things you can't switch back to visual (I prefer visual). For me, doing jumping links makes the same issue for me.

One tip, for anyone with this problem, is that now when you save this post in text, it will then open all other posts in text editor too. If you save the next post while in visual, it will then open all posts in visual. That means if you save your next post in visual, then go back to 'this post' and have it open in the visual editor, you will lose your code!

So....I'm hoping for a plugin to come out soon. Or maybe something like YouTube where you can just click 'share', highlight, copy,paste.
Reply
welshy Premium
I'm surprised Wordpress hasn't already added the ability to embed with just the URL.
Thanks for the tip too.
Reply
lanesamarie Premium
I'm always learning new everyday, great post Craig and thanks for sharing:)
Reply
welshy Premium
Thanks Nenita, just sharing something I came across today.
Reply
Top