• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

How To Include Custom Page Templates In Your Themes Sub Directory

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.

include page templates in themes sub folder

This new folder is a good place to store your landing page, full width and other page templates like your author & contributors page templates.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.