Creating a default Custom Post Template that a Theme can override

You might want to look at the routine that WP uses for this: locate_template(). It is in wp-includes/theme.php and is called from a number of functions in that file. Those functions are used by wp-includes/template-loader.php to select the correct type of template based on the current page and then walk up the theme hierarchy looking for a match.

Leave a Comment