1

Hay, I'm making a WordPress template, and i have 4 main pages.

HOME
BLOG
CONTACT
ABOUT US

As you can see "Blog" is a page (i need it to display when i call wp_list_pages()), but how do i edit this blog page? I assigned the "Blog" page a custom temeplate (called blog.php), but when "Blog" is set as the "Post page" in the Reading section of the WordPress admin, the page fails to render the template.

How do i edit this "Blog" page?

migrated from stackoverflow.com Mar 29 '11 at 16:44

This question came from our site for professional and enthusiast programmers.

  • 2
    for wordpress.stackexchange.com ? – Trufa Mar 29 '11 at 15:41
  • Does it work as normal page? Btw: show us your code and tell us what exactly you tried so far. – kaiser Mar 29 '11 at 16:49
4

Setting page to be "posts page" changes its template hierarchy to follow home page rules.

So your custom template is ignored and it looks for home.php or index.php, which might or might not be the reason it fails to render.

  • So home.php is the blog page, and index.php is the home page. Is this documented anywhere? – dotty Mar 30 '11 at 8:10
  • @dotty not quite, home.php is home page with list of latest posts and index.php is fallback template for everything that doesn't have more specific template. See Template Hierarchy in Codex. – Rarst Mar 30 '11 at 9:36
1

When you set a page to be the Posts Page, it will override any custom template or content you assign and automatically use index.php to render the posts loop.

  • Actually, at least if the site is set to use a static Page as the Front Page, then whatever static Page is assigned for the blog posts index will use home.php. – Chip Bennett Mar 29 '11 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.