Don’t use the Genesis Blog Page Template

(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

Bill Erickson

Bill Erickson is the co-founder and lead developer at CultivateWP, a WordPress agency focusing on high performance sites for web publishers.

About Me
Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk

Reader Interactions

Comments are closed. Continue the conversation with me on Twitter: @billerickson

Comments

  1. Jim says

    I am so glad I saw this post. Two of the recent post, since the update to the latest Genesis, were not showing up in the blog page which was using the blog template. However, as soon as I created a blank Home page and used the Settings > Reading the right way, the posts showed up. I did not change anything in the theme files. The theme was already using front-page.php so the latest version of Genesis must have caused the post to not show up. Is there another explanation?

  2. Jono Farrington says

    I have a newbie question. What I want to do is replicate the current home page (static front page in settings), to an inner url i.e domains.com/xyz, and then set this to the home page.

    Is there an easy to way to replicate the widgetized homepage?

    Thanks,

    Jono

    • Bill Erickson says

      A front-page.php file is only used for the front page of the site. But if you name it something else, like template-home.php and add /* Template Name: Home */ at the top of the file, it will now be a page template available for any page. When editing a page, in the right column you can select what template is used.

  3. Zach says

    Programmed a custom blog page template for my client per your advice, but now Feedburner can’t pickup the blog page template I assigned unless I use the Genesis Default Blog Template. My template doesn’t seem to overwrite that functionality in the wordpress backend. Is there something simple you know I should do moving forward?

    • Bill Erickson says

      I’m surprised the blog page template worked with Feedburner. I thought WordPress core provided the RSS feed URL in the document’s head based on the posts page as set in Settings > Reading.

      I haven’t used Feedburner in years though, so maybe someone else can provide guidance.

      • Zach says

        Sorry for the waste of time. In order for that to work you need to use home.php as the file name in the genesis child theme AND assign the reader settings as well. Once I updated the file name Feedburner tapped in immediately. SORRY!

  4. David Hedley says

    Hi Bill,

    As a starting point for home.php, do I just add genesis(); and nothing else (apart from any customisations of-course).

    Thanks

    • Zach says

      In my experience you can use the default genesis loop for the blog loop, but it doesn’t look very appealing by default. This was the most recent project I did, while modifying the loop. https://www.unlimitedsiding.com/blog/ There is only one post for them so far, but as the continue to post it will produce the same results underneath and style them accordingly. With the right CSS and php you can get some pretty appealing results.

    • Bill Erickson says

      Yes, that’s all you need. Think of the home.php file as a functions.php that only applies to the blog homepage.

  5. Alexander says

    Hello everyone!
    I have created my front-page.php using the guidance provided by Bill in the above post.
    I have created the dedicated stylesheet that has all of the styles that apply to that front-page.

    Now I’m stuck with adding Media Querries to that new stylesheet. The querries simply don’t work!
    Where should I use them? (original style css that applies to the child theme? or that new stylesheet dedicated to front-page.php?) Should I add vieport support into the new front-page.php?

    Media Querries worked fine before I decided to create that front-page.php

    Thanks!

    • Bill Erickson says

      Why create a separate stylesheet? You can just add them all to the main stylesheet. Use the .home body class to limit them to the homepage.

      Whether you use one or two stylesheets, media queries should work the exact same in both. Add this to your stylesheet to target screens smaller than 768px:


      @media only screen and (max-width: 787px) {
      // your mobile styles go here
      }

  6. Corey Tat says

    Hi Bill,

    I was frustrated for months on how to fix this issue. I was using the Magazine Pro theme for Genesis.

    Your post was very detailed for me to include my blog posts on my home page.

    Thanks a million!

  7. VipiN infoBee says

    While searching for how to build custom front page for my genesis child theme i reached here. Your replies to comments helped a lot. Thanks

  8. Komal Barde says

    Hi all,

    I am using Minium-pro theme with Genesis.And I have done below setting for Reading:
    Front page setting: Your latest posts

    For this setting the home is getting displayed as I excepted , but the Blog page is apperaing blank.

    And if I change above setting to as follow:
    1) Front page setting: Static pages
    Front page: Home page
    Blog page: Blog page

    The Blog page lists all latest post , but on home page it is not displaying the blog list and other content like slider on home page is coming properly.

    Please tell me if I have missed anything.

    Thanks in advance,
    Komal

    • Bill Erickson says

      Take a look at the actual files in the theme. A home.php will always be used for the blog, so if you have the blog on the homepage it is used there, or blog on separate page it is used there. A front-page.php file is always used on the front page (whether or not it is a blog).

      My guess is the homepage you want is using a home.php file. Renaming it to front-page.php will let you use it on a static front page.

  9. Bohan siril says

    Was having doubts on whether to use a front page template or leave it as it is. I was also using the Genesis theme. After reading this, I think, I should have a second look at it.

  10. kevin says

    Here is a question I did not see addressed in the comments. I have a site with two distinct blog pages, meaning two separate templates. When I write a post, I select from a metabox which template that particular post will utilize. In my menu I have separate links to each of these blogs.

    So, is there a way to implement the advice of your post in this situation? Should I have structured this differently? (If I assign only one of these pages as the “posts” page, what would happen to the other?)

    I chose to do it this way so that I could utilize the same categories for posts while not still having control over which page it would appear on…but your article has caused me to second guess that approach.

    Any suggestions would be welcome.

    • Bill Erickson says

      What you’re describing is a perfect use for a taxonomy. You could either use one of the built-in taxonomies (Categories or Tags), or create your own. Register a taxonomy, then each “distinct blog” is actually a term archive in that taxonomy.