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?
To use a static Front Page, you need to do the following:
- 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"
- Go to
Dashboard -> Settings -> Reading
- Set "Front Page Displays" to "static page"
- 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 nofront-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 Pageindex.php
in all other cases
If you still need some clarification, see the Codex entry for Template Hierarchy.