+321 123 4567
info@test.com
  • Home
  • My Services
    • Web Design
    • Web Development
    • Technical Writing
  • Portfolio
  • My Thoughts
  • Free Tools
    • Photo Editor
    • Avatar Generator
    • Email Migration Tool
    • QR Code Generator
    • RSS to HTML Converter
    • Rich Text Editor
    • IP Address Geolocation
    • Base64 Image Encoder
    • NATO Translator
    • All Tools
  • Contact
Home
Webmasters
Fix: Facebook Post Embed not Working on WordPress

Fix: Facebook Post Embed not Working on WordPress

Wale Adekile
October 7, 2015

Sometimes around March, embedded Facebook posts stopped working correctly on WordPress. This doesn’t seem to affect WordPress alone, it seems to affect other platforms as well. A lot of people speculated it was because Facebook changed certain things in their API but embeds included on web pages before March still appears correctly. Till now, the issue remains the same and post embeds appear as a hyperlinked text.


There’s a small fix though and it’s pretty easy. For embeds to work correctly, a snippet of JavaScript including Facebook SDK has to be placed in your site’s head section.

1. If you’re using Genesis, you can easily go to Genesis > Theme Settings > Header and Footer Script and paste the code in the head section. Using a different WP theme, you can get Header and Footer plugin to implement the code.

2. Copy the code below:

<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v2.3'
});
}; (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/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

3. And paste it in the site’s head section.

This is all I did that fixed the issue. Putting the code in your footer probably won’t work correctly, it has to be in the head section.



Previous Post
6 Awesome Things You can Do on Android with an OTG Cable
Next Post
Two Ways to Download Facebook Videos on an Android Phone
Wale Adekile
Husband to the world's most beautiful woman and father to two awesome kids. A nerd, obviously; also, a technical business analyst, a web designer who preaches the gospel of WordPress, and a writer. You can check out my published books on Amazon.
secure wordpress from hack attack
Wordpress

5 Tips to Secure your WordPress Blog from Hackers

14 years ago
speed-wordpress-up
Wordpress

10 Easy Ways To Speed Up your WordPress Blog

12 years ago

Recent Articles

wahl rapic clip hair clipper
Wahl Rapid Clip Hair Clipper Review: DIY Made Easy
BenQ LaptopBar Review: Luxury or Necessity?
yunmai easepro unboxed
Yunmai EasePro Massage Gun Review
g20
Teendow G20 Robot Vacuum and Mop Review
bathroom
Dear Men, Spraying All Over the Toilet Seat is Disgusting and Irresponsible
winx mediatrans
How to Transfer Photos from iPhone to Computer Without iTunes
google workspace
How to Migrate Emails From Google Workspace/G Suite to cPanel
synology diskstation ds920+
Synology DiskStation DS920+ Review
playstation 4
Why I haven’t Upgraded to the PlayStation 5 Yet
pain
Started Watching Anime as an Adult? You’re Not Alone

All contents on this blog are copyright protected and cannot be reproduced on other websites without permission.

Copyright © 2022 – NerdieDad | Home | Contact | About | Privacy Policy