It sounds like is_page_template()
should do it.
I’m still a little mystified over how Default and Custom Templates work, however.
I’ve renamed the page.php file in my theme directory to custom_page.php and added the appropriate php comments at the top of the file (I called it ‘Custom Template’). Now I can see ‘Custom Template’ in the drop-down menu when I Add New Page–but I also see ‘Default Template’. Where did this ‘Default Template’ come from?
It looks like this ‘Default Template’ simply uses index.php
, which inserts the_content
of the Page as well as the comments_template
, sidebar
and footer
. I assume I can use is_page_template()
to customize (or omit) each of these components as needed.
Since I want all my Pages customized the same way, couldn’t I just use is_page_template('Default Template')
in each component file of my theme to effect my Page customizations? Why bother with a custom Page template?