“There is no is_subpage() function yet”… how to use this?
-
Hello,
I would like to trigger stuff when sub page is viewed. The article Mentions that theres nosub_page()
and gives an option:<?php // Get $post if you're inside a function global $post; if (is_page() && $post->post_parent ) { // This is a subpage } else { // This is not a subpage } ?>
I’m a bit confused how to use this?
Say, if it would exist, this would be the case:
<?php if (is_subpage('19')) { include(TEMPLATEPATH . '/header2.php'); }
How should I incorporate the code in this? I tired wrap my head around it for some while with poor results.
All help is appreciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘“There is no is_subpage() function yet”… how to use this?’ is closed to new replies.