(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
Brian says
Bill, I think I’m on the right track for fixing my site that’s about four years old. I’m using the Genesis Corporate Child Theme and I have the front page set up with widgets and a separate blog page. Everything works fine on the desktop without changing the Reading settings to a static front page, but I am trying to make the site mobile compatible using a plug in (I’ve tried a few different ones) and my blog page is blank on the mobile site.
I can change the Reading settings to a static front page (but not choose anything) and set the blog page to /blog, but I get a white border on the front page and some content gets cut off. Otherwise, I don’t know what page to choose as the static front page.
I tried changing the name of home.php to front-page.php and then changing the reading settings, but then my home page just shows the blog.
Is there any way to keep the widgets on the static front page and get the mobile site to show the blog page? I’ve tried most of the options you’ve suggested above with no luck. Hopefully I am missing something simple.
Thanks,
Brian
Bill Erickson says
Create a page called “Home”, then go to Settings > Reading and set “Home” as the front page and “Blog” as the posts page. This should fix it. If you’re still having trouble with the front page display, you might need to hire someone to look at your specific problems and fix them. Codeable.io is a great service for that type of work.
Brian says
Thanks Bill. I gave this a shot and now it has the blog on the front page and the front page on the blog page. It still has the same white frame issue as well. I will check out the link to see if I can find someone to help. Thanks!
Randall says
Hey Bill:
As everyone before has said (and the functions.php to Minimum Pro): props dude.
Context: Magazine Pro; Settings > Reading > Blog page chosen rather than Genesis Blog page template.
Question: If I want multiple blog-style pages for each respective category, etc., Genesis functions.php permits this. Your post argues against adopting this with the caveat that the HTML 5 themes ‘should’ be fine.
Is there a better solution than the native Genesis approach? By extension, would I need to add something to the child theme functions.php?
Thoughts?
Bill Erickson says
WordPress already provides blog-style pages for each category. It’s yoursite.com/category/[category slug].
If you’d like a different category archive page, can you provide more details about the context? Why is the existing category archives insufficient?
Randall says
Hey Bill, thanks for the reply.
I may not have correctly articulated my question.
In Genesis, one needs to choose the “blog template” in the lower right quadrant of a page editor before publishing in order to render the blog effect. This is necessary even if one chooses a/the blog page under Settings > Reading > Posts Page.
Building on this, if multiple blog-formatted pages are desired (for categories in this case), the only approach I see without functions.php surgery is to choose the blog template in the page editor and then create a custom class: query_args and then value it to the corresponding category.
I understood your article as disfavoring the use of the blog template included in Genesis. If the approach I outline above is not optimal, do you recommend an alternative that is accessible/simple. or is the above cool on the HTML5 themes?
Bill Erickson says
No, you do not need to select “Blog Template” if you are using Settings > Reading. When you specify it in Settings > Reading, WordPress ignores any content that’s on that page (including the selected page template), and instead does a query for latest posts.
WordPress also automatically creates dynamic archives for categories, tags, authors, dates (year, month and day archives), and other things. You do NOT need to create pages for each category, and then select a page template. All you have to do is create the category, WordPress does the rest. Your category archive will be accessible in /category/[category slug], assuming you haven’t changed the category base permalink in Settings > Permalinks.
On all the themes I build, I actually remove the blog page template so it isn’t available to clients. The code is included in the last line of the post above.
Chavi Rokach says
Thanks. I needed this spelled out- it was perfect help!!
Derek Magill says
Hey Bill,
Do you know if there’s a way to display content on the latest posts homepage, above the posts?
OR
To set a blog page template as the front page but display the page content instead of just the posts? I can do this on a standard blog template page but I can’t (from what I gather) do it if I set the blog template page as the front page.
Bill Erickson says
Try this: https://www.billerickson.net/dont-use-genesis-blog-template/#comment-13307
Tim says
This is the best most helpful gem of WP info I have come across in weeks.
Thanks!
Bill Erickson says
Thanks!
Jamie Mitchell says
Hi Bill
if setting a static page as the home page (in readings > static page)
and, i also want that page to use a custom template (i may want widgets areas or a second loop on the page as well as the page content)
should i still use front-page.php or a page template name, like page-front.php ?
thanks!
Bill Erickson says
You don’t have to use front-page.php for your front page. That’s just the first template in the hierarchy.
Here’s the hierarchy for a static front page: front-page.php > Page Template > page-$slug.php > page-$id.php > page.php > singular.php >index.php
WordPress starts at the top of that list and works its way down. Once it finds a template file that matches, it uses that. So by default a front page might use the same page.php file as any other page. If you create a page template and set that front page to use the page template, that overrides page.php. If you create a front-page.php, that overrides whatever page template you have selected.
Jamie Mitchell says
awesome, thanks Bill for clearing that up
you explains things in a way that even i can understand 🙂
SWahl says
For client site, using News Pro, have a front-page.php file and set blog page to a page using WordPress settings and front page to a blank page as detailed in previous comments. All works well but one thing. Have categories renamed as articles, and when you go to the main article/category page http://www.rosshoward.com/articles the next buttons to go to the next page of articles breaks and gives me a 404.
Anything here I’m missing? Is it because I renamed the category to something custom?
TIA!
Bill Erickson says
Are you saying you changed the category slug from /category to /articles? If so, there isn’t supposed to be a page at /articles on your site. There are only category archive pages for each specific category; e.g., /articles/category-name.
Michael Einstein says
Hey there..
I am new to Genesis (not WordPress), and working on moving my site to Genesis using the Eleven40 Pro child theme on a sandbox site.
So far, making progress, but one question..
On the Eleven40Pro Blog page, it always displays my first blog post as a full page post, and then the rest of my posts show up with thumbnails and excerpts…
How can I change it so that the it doesn’t do that for the first post.. and just displays a list of thumbnails and excerpts…
My current theme has an “option” to display the first post as a full page post or not, but don’t see any such option In Genesis or the customizer for Eleven40 Pro.
Thanks.
Michael
Bill Erickson says
I haven’t used the eleven40 theme so am not sure how they are doing that (that’s not a Genesis feature). I recommend you contact StudioPress support.
Chandan says
Hi Michael,
I faced the same problem like you and solved it. One of my clients wanted to get rid of the grid layout just like you want. All you have to do is rename your home.php to home-old.php
Tony says
Hi Bill,
Just wanted to thank you for this article, it is invaluable to me.
Thanks so much for all the knowledge.
Oluwatoyin says
I want to display the page title of the Blog page like you do here. How do I do it? Genesis themes do not show the page title.
Bill Erickson says
In your home.php file, add something like this: https://gist.github.com/billerickson/0c9b398d2c08e22ff318
Oluwatoyin says
Good day, Bill,
Thanks for the prompt reply. I forgot to mention that I’m using the HTML5 themes. I tried to use the code you suggested, in the front-page.php, but I saw no difference. Where did I go wrong, please?
Bill Erickson says
It belongs in home.php, not front-page.php
home.php powers your blog homepage.
front-page.php powers your static front page
Oluwatoyin says
Thank you, Bill. Now I have a Blog page title. But how do I relocate the Blog page title below the header? I relocated the entry title below the header, but the blog page would not go. I used the code here: https://gist.github.com/srikat/8801138. Please help.
Rob says
Hey Bill,
I broadly agree with the idea of doing it “the WordPress way”, and understand the limitation the Blog Page template has regarding the main query.
But I think there are some cases and reasons why it could be useful to keep the Blog Page template around…?
For starters, using the reading settings means that you have to create a ‘stub’ page for the homepage as well as one for the blog page. This can be really confusing for admin users, especially in the most recent Genesis themes which have a widgetised homepage, as they see an edit link on the homepage which goes through to a “blank page” if they try to use it.
It also makes the homepage more vulnerable, as if the stub homepage is ever (accidentally) deleted then WordPress defaults to showing the blog in preference to the widgetised page.
That aside, I think the main reason it is useful is to very quickly and easily create a category page (i.e. an archive style page where the slug is /the_category rather than /category/the_category) , without messing around with custom post types.
And the main query limitation isn’t such as killer, as Genesis lets you customise the query for this template out-of-the-box using a “query_args” custom field.
Cheers
Rob
Bill Erickson says
You bring up some good points. But I think the “confusing” user experience is actually caused by mis-using widget areas for the homepage. Widget areas should be site-wide content, like a sidebar or footer. If there is content that belongs only on one page (like the homepage), you should be able to edit it by going to Pages > Home.
I never use a widgetized homepage for my clients because, as you say, it’s really confusing. I create custom metaboxes that allow them to edit all the homepage content from the homepage.
There’s a few reasons I think StudioPress uses widgets instead of custom metaboxes. First, it’s less work and less code. It’s much easier to write
genesis_register_widget_area()than to include a metabox library like CMB2 and then write a function that builds the metaboxes. Second, when you change themes all your current widgets will show up in “Inactive Widget Areas”, so if you go from one StudioPress theme to another, you can then reassemble your homepage using the last theme’s widgets.But if your goal is to craft the best user experience for the website owner, a widgetized homepage is not the solution (IMHO).
Rob says
I guess what I’m saying is that the advice depends on the audience…
If you are creating a customised template from scratch for a client, then I absolutely agree that avoiding a widgetised homepage and the blog page template is going to deliver the best website owner experience overall. No question about it.
But if you are a website owner just tweaking one of the pre-built genesis themes to suit your needs – as seems to be case for many of the commenters here – then I think it probably makes more sense (i.e. simpler) to stick with the blog page template as supplied by StudioPress … unless you need something that can’t be achieved using the “query_args” custom field.
Cheers
Rob
Ps – BTW, I really like your custom metabox approach, it makes a lot of sense.