I have a childtheme of twentythirteen in which i want to use the same template for pages and the blogposts-overview. But in twentythirteen is a page.php and an index.php. So I need override both, meaning I have to do all edits twice.
Any elegant solution for that?
Create
index.php
and format it the way you want.Then create
page.php
and load the index file with something very simple like:Note: This is untested and I am not able to test this right now. If there is a problem, leave a comment and I will run proper testing later and get back to you.
You can use the template filters to force a template for specific kinds of requests.
In this example, we load the
page.php
template for the blog posts page: