If I run the following query on the WordPress database, I get a list of templates:
select distinct(meta_value) from wp_postmeta where meta_key='_wp_page_template';
The templates that come back are things like default
and templates/page-fullwidth.php
and my-template.php
. With the exception of default
which I assume is a special case, these are clearly relative filenames. The trouble is, I know they're not all relative to the same directory!
So how can I find out where exactly where each template exists in the filing system?
page.php
. So in your above case it would be/theme-name/templates/page-fullwidth.php
– Howdy_McGee♦ Mar 18 '16 at 14:22_wp_page_template
is specifically for the Page Attributes template dropdown menu. If plugins are indeed adding templates to the menu that are outside of the theme directory, you need to determine by what mechanism the plugin is intercepting that value and properly loading the templates. There is no mechanism built into core that allows that without modification to the template loading process. – Milo Mar 18 '16 at 16:51template_include
filter that checks the template and returns the actual filename if the template belongs to the plugin. – IpsRich Mar 21 '16 at 9:17