Thesis and Featured Content Gallery Does Not Work On A Static Front Page
Out of the box there is a big problem when trying to use a Thesis Feature Box on a site with a static Home page where the Feature Box is populated using the Featured Content Gallery plugin.
The text for the home page does not display correctly. In fact, it does not display at all. Instead what is displayed is a number of teasers for the posts featured in the Featured Content Gallery plugin.
This article provides a fairly easy workaround that allows you to put a Featured Content Gallery on your static home page on a Thesis WordPress site.
Circumventing the Bug With Thesis and Featured Content Gallery
The bug which may be in Thesis, or may be in Featured Content Gallery, or may be just an incompatibility between the two means that Thesis decides to display the posts featured in the content gallery rather than the static page.
With the Thesis feature box, the code for reading the featured posts runs before the code that displays the home page. To circumvent the bug, we make the featured content gallery run after the home page display, and then use CSS to overlay the Featured Content Gallery on top of the feature box.
Overlay the Thesis Feature Box With the Featured Content Gallery
Thesis Feature Box Settings
Thesis Feature box is set up to display on only the front page as follows:

Custom Functions for the Feature Box and the Featured Content Gallery
No code is required to be added at the ‘thesis_hook_feature_box’ as the box is empty.
The Feature Content Gallery code is executed only of the front page and the Thesis hook is ‘thesis_hook_after_footer’ which means the Featured Content Gallery code is (crucially) executed after the home page text has been displayed.
function my_featured_content(){
global $post;
if (is_front_page()) {
include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php');
}
}
add_action('thesis_hook_after_footer', 'my_featured_content');
If you try running at this stage then the front page will display correctly with the Featured Content Gallery beneath it. The next stage is to use CSS to make the gallery appear above the home page text.
Custom CSS settings for the Feature Box and the Featured Content Gallery
Changes to custom.css are as follows
- Specify the required height and width of the empty feature box as a placeholder for the Featured Content Gallery
- Use absolute positioning to overlay the Featured Content Gallery on top of the empty Feature Box
.custom #feature_box{ padding-left:0; padding-right:0; height:270px; width:985px; }
.custom #featured{ position:absolute; top:178px; }
Of course you will need to set height, width and top according to the size of your slideshow images and the depth of your header. In this example the slideshow images were 985 by 270 pixels and the header depth was 178 pixels.
Overlaid Featured Content Gallery on a Static Home Page
It looked like this:












{ 12 comments… read them below or add one }
Thanks for writing this tutorial – it clarified some questions that my client and I had. Woohoo! I love Thesis.
.-= Donna Payne, The Web Coach´s last blog ..Web Coach Tip: Top 10 Deadly Web Site Design And Copy Mistakes for 2010 =-.
Does this methodology work with Thesis 1.6?
.-= kcortez´s last blog ..Grace Potter and the Nocturnals in Carrabassett Valley, ME 04947 on 03/13/10 =-.
Yes this does work for Thesis 1.6.
No success, but close:
http://www.goseethisband.com/?page_id=2782
I see everything there yet FCG doesn’t appear to be displaying anything. I look at the CSS and it looks ok. Any thoughts?
.-= kcortez´s last blog ..Grace Potter and the Nocturnals in Carrabassett Valley, ME 04947 on 03/13/10 =-.
Thanks so much for this tutorial.
Tried it out at a site that I’m developing at http://www.ukbusinesswebsitedevelopment.co.uk
Works perfectly with Thesis 1.6.
Tony
.-= Tony´s last blog ..Testimonials =-.
Hi thanks for this it works perfect. I am doing a site for an artist and this worked real nice to show off images on the front page. I dont want to show any text at all on the front page. How would I get rid of the text that now appears under FCG??
Thanks again!
Hi David,
I think what you need to do is set the “Text Overlay Height in Pixels” to zero if I understand the text you are referring to.
If that does not work, please supply your URL so I can take a look
Russell
Thanks heaps mate. Was able to get it to work with your help
Damien´s last [type] ..FHTM Under Investigation Over Pyramid Scheme Claims
I tried using the gallery on my site but when I enable the plugin, the post pages do not load. It just shows me the homepage even for the post page.. any pointers?
Pete, make sure you set the gallery to appear only on the home page.
It sounds like you might have a plugin conflict, check your page for javascript errors – this is probably easiest done using Internet explorer and looking for an error/warning symbol at the bottom of the page
Great solution, but I am trying to have a sidebar column along side this. Had originally had used a hook below the headline to position properly, but of course ran into the bug re static page. Your solution works great if you want the gallery to span the entire page, but have any suggestions for how it might work to have the right hand column essentially “wrap around” the gallery?
Thx much.
Regards
Rich,
How have you set up the feature box?
What we are try to do here is reposition the FCG in the space created by the empty feature box.
As long as the FCG is of the right size then it should not make a difference whether it is full width or just above the content section only – the process is exactly the same
Regards
Russell