(Short answer: it’s not the main query, so customizations to the query won’t work. Make your blog the WordPress way, using Settings > Reading).
Genesis has been under development for quite a few years now. Given it’s history and large user base, there’s a few old features that would be removed, given the opportunity, but are needed for backwards compatibility – so people who have used them in the past can keep using them.
The biggest one (in my opinion) is the blog page template.
When you first install WordPress, your homepage lists your most recent blog posts. If you’d like a static homepage and to move your blog to a subpage, you can do so in Settings > Reading.
WordPress looks at specific files for these different pages. home.php is used for your blog posts listing (whether that’s your homepage or a subpage). front-page.php is used for the homepage of your site, whether you want blog posts or a static front page.
So, if you want a static homepage and your blog on a subpage like /blog, create the pages “Home” and “Blog”, go to Settings > Reading and set those as the appropriate pages to be used. If you’d like to create a template file to control the homepage, use front-page.php. If you’d like to create a template file to control the blog, use home.php.
Many of the older StudioPress child themes incorrectly use home.php for their static homepage. I’m not sure the reason, but my guess is they wanted to save people the step of going to Settings > Reading; when the theme was activated, the homepage was already a static homepage. The problem here is now you can’t have a blog. If you created a page and set it as the blog in Settings > Reading, it would use the home.php file which is now a static homepage.
Their solution to this was to create a page template that lists blog posts. The problem here is the blog posts are listed in a custom loop, not the main loop of the page (the main loop is the page’s content, which is replaced with this custom loop). This means plugins and other code that are designed to modify the main blog do not work.
What I recommend:
1. Never use the blog page template.
2. If you’re using a StudioPress theme that has home.php in it and it’s used for a static homepage, rename it to front-page.php. If you’re using one of the newer HTML5 themes, you should be fine. It’s only the older ones that have this issue
3. If you’re building a child theme for your client, exclude the Blog page template
kevin says
A little info: I am using genesis 2, and create my own child theme for companies I work for. So I use a static home page, using a custom template named page_home.php which I then created a home page under pages and set to template page_home.php, which I can easily do your suggestion of renaming to front_page.php.
But I am confused, I am using genesis, so then I wanted to created a blog, I go to pages and create blog and set the template to Blog which is provided with Genesis 2. Are you saying this is not the best idea? How then am I to create a page with blog that lists all my blog postings? Just a bit confused as this has always worked well for me in the past and I do not see a home.php in the genesis folder, just the page_blog.php template which uses the lib/loops file. I am assuming I am using this the correct way? Let me know if I am not being clear and thanks so much.
Bill Erickson says
A better approach is to use WordPress’ built-in blog rather than the custom page template Genesis provides.
If you’re not making any serious customizations to the blog you won’t notice a difference (which is why you haven’t had a problem using the page template). But it’s better practice to use WordPress core features rather than a custom page template.
On the next site you build, create a page called Blog. But instead of assigning it the “Blog” page template, go to Settings > Reading and set that as your posts page. Same result, but doing the right way.
kevin says
Thanks for the feedback. I set the blog page to posts page in reading. So now if I want to make customizations to the blog page I should add a home.php file to my child theme and make any edits there rather than adding a page_blog.php file and making edits in that file? So I am editing the core wordpress blog rather than the genesis template blog?
Bill Erickson says
Correct, use home.php for customizing the blog.
But also make sure not to remove the main blog loop like you’re doing in page_blog.php, or else you’re back to where you started.
Juan Rangel says
Good post! I have used the Genesis blog page for a while now. Most of the sites I create use a custom home page with no loop so adding a blog page, setting the template, and adding it to the menu was fairly easy.
Sabrina says
Thanks for the info on the changes.
Josh Mallard says
Thanks for this post.
I’m a home.php culprit. I’ve been lucky since the sites I’ve built since switching to Genesis either had no blog or the blog was the home page. Will definitely be changing how I approach this now.
kevin says
Alright I have everything changed over to your suggestions, any custom code for the blog is in home.php and the only thing outside my code is Show Crumbs on Posts page? I checked in reading and my posts page is set to Blog page? I removed any code I had filtering the crumbs but still it is not appearing?
2) To help users of my website, how exactly do we remove the Blog template from the templates dropdown, so I can then rename my home.php file to Blog so they are not confused?
Thanks Bill interesting article. Sorry for the multiple questions but hopefully this helps others out as well.
Bill Erickson says
Go to Genesis > Theme Settings, you should be able to control the breadcrumbs from there. When you’re using the Blog Posts page, it gives you a “Front Page” and “Posts Page” option for breadcrumbs.
Until this makes it in to WordPress core ( https://core.trac.wordpress.org/ticket/13265 ) we can’t remove it from the dropdown. So go over there and ask for it 🙂
kevin says
Odd it doesn’t seem to be applying the breadcrumbs to the blog page (set to posts page). I removed any filtering code related to the crumbs? hmm I will have to do some research.
Will def. ask for the change.
kevin says
Supercache issue, ‘my bad’ : /, displaying correctly and worked in the articles suggestions, thanks so much.
If we name the home.php template to Blog would it override the page_blog.php template that is listed in the dropdown? Or would we most likely see conflict issues with having 2 templates named blog?
Bill Erickson says
If you have a theme file named page_blog, it will be used instead of Genesis’. But that doesn’t solve the problem. You shouldn’t be using a page template for your blog.
Terry says
Thanks for the clarification on this Bill. Love Genesis, but this was confusing in the beginning.
Puneet Sahlaot says
That’s a brilliant explanation Bill! I can see the obvious reason for such a step of using home.php could be none other than skipping “Reading” settings.
And this is a common problem with many other themes out there which force a custom home page design in this manner.
Chris says
So I’m confused.
I want to use all the widgets that the Genesis child themes use for the home page. I’m using Executive Pro in a site as an example. Yet using all of the widgets (Home – Slider, Home – Top, Home – Call To Action, Home – Middle) only seems to work when Reading Settings > Front page displays is set to Your latest posts.
If I set Reading Settings > Front page displays to A static page, I can specify the Posts page where I want the blog to show but I don’t have an actual page to set the Front page to.
I want the Front page to use all of the home page widgets specified in the theme.
Is there a way to do that or is there no way to use the theme home page widgets (which a lot of the Genesis themes do) when setting the Posts page in Reading Settings?
Thanks!
Bill Erickson says
Yours is one of the themes I described above that has the template file for the homepage named incorrectly. If you rename
home.phptofront-page.php, you’ll be able to have your widgetized homepage as well as a blog using the WordPress core method (Settings > Reading).But this post really isn’t for you, the end user who has a theme working the way you want. Just leave it as is.
This post was written for two types of people. The first are end users (like you) who are trying to use a plugin like Genesis Grid but it won’t work due to the issues described above. The second are developers, so that they build it correctly the first time.
Chris says
Bill,
Thanks for the reply. Just want to understand how this is supposed to function.
Actually Executive Pro (being newer) doesn’t have a home.php. The page template is named front-page.php.
So when I set the Settings > Reading > Front page displays to
Post page: Blog
Front page: leave blank
should the home page still display the home page widgets?
Thanks!
Bill Erickson says
Yes it should,but you should also set a page for Front Page. I’m not sure what it will do if you leave that blank.
I always create a page called “Home” and set it as the front page. Even if it’s widgetized and the content is managed elsewhere
Chris says
Yep that did it.
I set the Front page to Home (I did have a page for it though it was blank) and the widget content showed back up.
The problem must have just been leaving the Front page dropdown empty in Settings > Reading.
Thanks!
Kristie says
Thank you for asking this question! I was having the same issue!
Anne Katzeff says
Hi Bill,
I’m not sure if I’m understanding the problem. Should I rename the Genesis “page_blog.php” to “home.php”, then use the “home” template for the Blog?
What I usually do is set my Readings Settings > Front page displays a static page named Home. The Posts page displays the Blog page, which uses the Blog template in the drop-down menu. This set-up works for me.
News Pro theme uses the “front-page.php” template for the static front page, I think.
Optimal theme uses the “page_landing.php” template for the static front page, I think.
thanks, Anne
Bill Erickson says
If you go to Settings > Reading and set a page you created to “Posts Page”, then it will automatically show blog posts. You do not need to select the blog page template on it as well. Give it a try. Edit your blog page and remove the “Blog” page template (switch to Default).
In either case, you’re not using that template. When you set it to “Posts Page”, you’re telling WordPress to not treat it as a page, so all the page settings don’t matter (like page template).
Settings > Reading only doesn’t work if your theme has home.php and is using it as a static front page rather than a blog. In that case, you’d rename home.php to front-page.php to fix it.
Anne Katzeff says
Got it Bill! Thanks for the additional clarification.
I changed the Blog page to use the default template, and it still functions as a blog. Fascinating. Didn’t realize that! You rock 🙂
Amber @ Au Coeur Design says
Thanks for explaining this, Bill. I had noticed a year or so ago that the blog template never recognized my loop customization and stopped using it (although I never really understood why). It is nice to actually know why I was having problems. Incidentally one of the first things I noticed that made me realize that there was something funky going on with the blog template was that if your Genesis Title Toggle plugin is enabled and set to remove titles from pages under the Genesis theme options then the titles also disappear from blog posts on a page setup with the blog template (but not on a page set the WordPress way).
Bill Erickson says
Yep, because the title toggle checks the main query (which is the page, not the posts) to see if the titles should be displayed or not.
Thanks for letting me know about this! I’m sure others have had a similar issue, so when it pops up in the support forum I can point them here.