Support » Themes and Templates » Static front page – editing index.php modifies posts page. Is that right?

  • Resolved dmyler

    (@dmyler)


    I’ve looked through several forum posts about the static front page sub panel, but can’t find an answer to my question. Basically — I can get the functionality to work, but only by editing index.php once all is said and done. That seems wrong to me (though perhaps it’s not).

    How I’m doing it:

    I’ve created two templates (‘site-home.php’ and ‘blog.php’), both of which contain loops, and I’ve published a page based off each template (‘home’ and ‘blog’). I assigned the ‘home’ page as my static front page. Works great. I then assigned the ‘blog’ page (based off blog.php) as my posts page. A list of my latest posts is generated, as expected, but editing the ‘blog.php’ template changes nothing on the page. Editing index.php does.

    Is that how it’s supposed to work? Seems to me the system isn’t reading my ‘blog’ page properly and is defaulting to index.php (as, apparently, WP is designed to do).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Brian

    (@wgbcworship)

    it is working correctly. at least, that’s how it works on my site with the same setup.

    Good to know, thanks! (And, to your point, it works, so perhaps I should just go with it.)

    Hmm, it should be simpler.
    1) create a Page called “home”, enter text.
    2) create a Page called “blog”, leave content empty. Or fill it. won’t matter, it will not whos
    3) set “home” as static front page in the admin (site.com/wp-admin/options-reading.php)
    4) set “blog” as article page in the same admin.

    That’s it. No need for templates or anything complicated.

    Though if you wanted to customize the loop for the posts page, you’d need to create a new template, I’d imagine. Following your steps means page.php is controlling the posts page and you’d either need to modify the loop on that template, or create a new one…

    No, that just tells WordPress that the Page called “blog” is actually not a Page but a list of posts. And customizing the look of this list would be done in the index.php.

    Thanks for the follow-up!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Static front page – editing index.php modifies posts page. Is that right?’ is closed to new replies.