Quick, simple. I have front-page.php
working in WordPress, and these loops over the main loop for my latest posts. The problem is the pagination template.
When I get to site.com/page/2
, it shows the same file template front-page.php
, but with the second round of posts. What I want is to show other file template, like paged.php
, but not even archive.php
or date.php
shows up.
Is there a code for this, instead of writing if (!is_paged())
wrapping the entire front-page.php?
Add a filter to
frontpage_template
and check thepaged
query var, adding your own template when it’s beyond the first page. I usepaged.php
in this example:Note the Filter Hierarchy Codex entry incorrectly lists the filter as
front_page_template
, but the function that applies this filter appears to sanitize the underscore from the variable before calling it, making it justfrontpage_template
.