Twentytwelve child custom templates not rendering as expected
-
Trying to get a custom page layout sorted, running a local WP3.6.1 installation on WebMatrix. The only plugin currently active is Jetpack. So no link to a working site I am afraid. I hope the steps I took will be sufficient for someone to spot the mistake I made?
Created a child theme of Twentytwelve by creating a folder called …\wordpress\wp-content\themes\twentytwelve-child. Copied some files from twentytwelve and modified them successfully to use as the child, and applied the theme in the backend. My very minor changes – mostly to footer content and CSS so far – showed up fine.
Now I want to make a custom template for a particular set of pages.
In the child theme folder, I created NPpage.php as a copy of page.php with
Template Name: NP page template
at the head of the code.
In the file, I call
get_header( 'NPheader' );
and NPheader.php currently just has a literal in place of the bloginfo description while I am testing.
I can assign the NP page template to a new page.
When I load the new page, sometimes I think I can briefly see the (shorter) description flash before it’s overwritten by the standard template description.
Looking at the code, WP knows the right template as this is in the output:
body class="page page-id-438 page-template page-template-NPpage-php ...
I’ve tried stopping and starting PHP, rebooting, and also looked in a completely fresh cache-cleared browser, and still can’t see my change. I must have missed something, but what?
- The topic ‘Twentytwelve child custom templates not rendering as expected’ is closed to new replies.