If you’ve created one or more custom page templates, you might like to place them all in one directory folder rather than your child or parent themes root directory.
Normally when you include or require a file in your theme, you need to add a line in your functions file like this:
include_once( get_stylesheet_directory() . '/includes/your-page-template.php' );
This won’t work with page templates and nor is it needed.
Simply create a new folder named page-templates in your themes root directory and add your custom page templates in this folder.
Here’s the function which has been added to the WordPress core since version 3.4 was released.
This new folder is a good place to store your landing page, full width and other page templates like your author & contributors page templates.
Leave a Reply