Many people reported that my Facebook Social Plugins WordPress plugin didn’t work with Internet Explorer 8. However, it was working fine with IE8 on most blogs and I didn’t have enough information to be able to reproduce the problem. Today, while helping a friend with her blog, I finally came across the problem and was able to figure out how to fix it. Here is the explanation of the problem and what to do to fix it.
First, the problem occurs only when using the XFBML version of the plugin by providing an application ID. When using this, the plugin inserts non-standard Facebook-specific HTML tags. IE8 simply discards unknown tags, so the inserted code is simply discarded and the plugins can’t load. Other browsers apparently do not discard such tags (though they can report a warning).
Fortunately, HTML can be extended and the browser be instructed to recognize non-standard tags. This is precisely what the plugin does. However, some themes miss a function call that is required for this to work. To fix it, log into your WordPress dashboard and go to Editor, under Appearance. On the right, there is a list of the files that make your theme. Click on Header (header.php). The code for that file loads. Near the top, there is a line that begins with <html. This is the line that will need to be edited.
If you see language_attributes in that line, then the code is already correct and the problem is something else. If however, you don’t see this, keep reading.
If you see dir=”ltr” on that line, remove it. Also remove lang=”en-US” (or another language code instead of en-US if your blog isn’t in US English) if it appears on that line. Next, add the following exactly as is at the end of the line, right before the >:
<?php language_attributes(); ?>
Make sure there is a space before that code. The final result may look like this, though it can differ too as themes are all different:
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
Then click the Update File button at the bottom. Reload your blog in IE8. If everything went well, you should now see the Social Plugins. If it doesn’t work or if this is too complicated for you to do yourself, post a comment and I’ll see how I can help you.