is_page_template not working on network site
-
I’m running into a weird problem. I’ve got a multisite installation that all uses the same theme. I’ve got a few sites in that network. The pages on these sites use different page templates and I show/hide content conditionally in footer.php depending on what page template is being used. The main site works fine, but for some reason, all the other sites on the network seem to return false no matter what is entered for the is_page_template() parameters (or even just leaving it alone and having no parameters)
Here’s my code:
<?php if ( is_page_template() ) { ?> <?php if ( is_page_template('template-full-width.php') ) {?> <?php //content specific for this page ?> <?php } else { ?> <?php //special content for pages that use a template that is not template-full-width.php <?php } ?> <?php } else {?> <?php //normally default content, but always displays on network sub-sites ?> <?php } ?>
Anybody know what might be going on here?
I’ve even done a wp_reset_query() before the footer and nothing…
- The topic ‘is_page_template not working on network site’ is closed to new replies.