WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Static front page - editing index.php modifies posts page. Is that right? (7 posts)

  1. dmyler
    Member
    Posted 5 years ago #

    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).

  2. Brian
    Member
    Posted 5 years ago #

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

  3. dmyler
    Member
    Posted 5 years ago #

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

  4. mores
    Member
    Posted 5 years ago #

    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.

  5. dmyler
    Member
    Posted 5 years ago #

    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...

  6. mores
    Member
    Posted 5 years ago #

    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.

  7. dmyler
    Member
    Posted 5 years ago #

    Thanks for the follow-up!

Topic Closed

This topic has been closed to new replies.

About this Topic