Assuming you’re only trying to display your blog posts index on a page other than the front page (i.e. because you’ve assigned a static page as your site front page), you shouldn’t need to do anything special. Refer to the Codex for step-by-step instructions for creating a static front page and separate page for your blog posts index.
Some caveats:
- Initially, don’t create any custom page templates or other custom template files. Ensure everything is working with the fallback template files (
page.php
andindex.php
, as per the Template Hierarchy). - Note: if your current Theme includes a
front-page.php
template file, WordPress will use that specific template file to render the site front page. - Note: if your current Theme includes a
home.php
template file, WordPress will use that specific template file to render the blog posts index. - If you want to create a custom template file to render your blog posts index, use the
home.php
template file. Do not give this template file aTemplate:
phpDoc header tag. You don’t need to assign this template file to the static page assigned aspage for posts
. WordPress will usehome.php
automatically, if it exists. - You should have no need whatsoever to create any custom queries or custom query loops, either via
get_posts()
orWP_Query()
. WordPress will use the main query loop to render the blog posts index.