• My site publishes a static front page with the blog content elsewhere.

    How do I use a custom template, rather than the default index.php, for that blog page?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can’t. You’d need to edit index.php.

    Thread Starter gulliver

    (@gulliver)

    Thanks.

    Still learning about template hierarchy, I’m reluctant to edit the index template because it’s used as a fallback for other pages.

    How do I use a custom template, rather than the default index.php, for that blog page?

    create a template home.php

    http://codex.wordpress.org/Template_Hierarchy#Home_Page_display

    Oooh – I’m reluctant to suggest that as I’ve seen installs where a home.php template has caused total confusion when the front page is the main posts page. I’d argue that it would be better to copy index.php and name the copy archive.php, so that the other archive pages have that to fall back on – leaving index.php to control just the main posts page.

    Thread Starter gulliver

    (@gulliver)

    Having re-read the hierarchy page and thinking more about this…

    I have single, page, archive, search, 404 templates – so there shouldn’t be an issue with editing the index template as it should never be called.

    Or have I misunderstood?

    I think you’re correct but, as always, when editing, make a backup copy of the file first.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Blog not on front page – use custom template?’ is closed to new replies.