0

I'm using front-page.php to generate a static frontpage for a Web site I'm working on. I can't seem to get Wordpress to display the blog posts on any other page. I tried creating a custom template to display blog posts, but it doesn't display any posts. Also, when I try to set the front-page as a static frontpage manually in the reading settings, it doesn't appear as an option. Help?

2

To use a static Front Page, you need to do the following:

  1. Create two static Pages, one for your front page content, and one for your blog posts index; their names are entirely arbitrary, but for our purposes, let's call them "Front Page" and "Blog"
  2. Go to Dashboard -> Settings -> Reading
  3. Set "Front Page Displays" to "static page"
  4. In the dropdown lists below, set "front page" to "Front Page", and "posts page" to "Blog"

Now, for some explanation:

  • WordPress will use your front-page.php template file when rendering your site front page, whether the front page is set to display blog posts or a static Page.
  • If you want to customize your blog posts index, use the home.php template, which will be used when a static Page is used to display blog posts, or when the front page is set to display blog posts if no front-page.php template file exists.
  • If neither of these two template files exist, then WordPress will fall back to:
    • page.php, for a static front page, or for blog posts if set to display on a static Page
    • index.php in all other cases

If you still need some clarification, see the Codex entry for Template Hierarchy.

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.