Update template hierarchy with blog.php, front-page.php templates, and custom URL routes

To make theming more logical and extensible for CMS users, the following changes should be made to the template hierarchy:

  • a blog.php template should be introduced as the default page template for the blog archive (whether on the front-page or on a dedicated page). After blog.php the template hierarchy would proceed as expected to front-page.php and home.php
  • If a custom page template is selected by a user, it should override all other templates, including blog.php, front-page.php and home.php. As the hierarchy is currently, you cannot offer homepage page templates in a child theme, if the parent theme includes a front-page.php. This removes choice from the user for no apparent reason.
  • TENTATIVE: Custom Permalink routing and embedding non-wordpress PHP functionality could be vastly simplified by offering a new file header comment that defines templates that should run at specific custom paths.

A feature plugin implementing these changes currently exists at: https://gschoppe.com/wordpress/better-template-hierarchy/


Read-only archive: https://petitions.classicpress.net/posts/122/update-template-hierarchy-with-blog-php-front-page-php-templates-and-custom-url-routes

Author: Greg Schoppe

Vote count: 21

Status: open

Tags:

  • request-modify-feature

Comments