I have a WordPress 3.5.1 installation on my WordPress Shack, with the Facebook plugin 1.3.1 installed and the TwentyTwelve 1.1 theme. I have the settings on Facebook – Comments box so that I display the comments box on posts and pages. In Settings – Reading, I checked a static page as front page, “Welcome”. I’ve checked the “Allow comments” checkbox for every page on my site.
However, the Facebook comments box is displayed on every page, except the front page, “Welcome”.
This definitely is an issue with the front page, because if I select “latest posts” to display on the front page, the comments box is displayed on the Welcome page.
How can I make that the comments box is displayed on the front page as well?
I of course posted this at the WordPress support forums for Facebook, but I don’t get any response.
Fast ‘n’ Hacky
The problem can be solved by changing line 319 in
facebook.php
to the following:This way, the front page is not treated as a home page but as a regular page, for which the facebook feature settings can be applied (and will be handled correctly).
More Elegant/Complex
Here is a non-hackish version. Put the following in your
functions.php
:I don’t have the plugin to test this, but looking at the lines to hack, as pointed by @tf:
I think it’s possible to short-circuit the third option –
} else {
– usingapply_filters( 'pre_option_' . $option, false );
.Something like:
According to the Template Hierarchy
front-page.php
orhome.php
will take precedence over the other pages.After reviewing the code for the facebook plugin the options there appears to be a different set of options for these cases.
Sounds like it could be theme related. I haven’t used Twenty Twelve much, but is the homepage generated from the Appearance > Widget section?
There are a bunch of themes that generate the homepage content based on the corresponding widget. Look in there for a box called
Content Left
Content Right
,Homepage Content
or something like that.This has tripped me up a few times.
You stated there is no
front-page.php
orhome.php
, but if I remember correctly there should be acontent-home.php
that is called from thesingle.php
orpage.php
.