Sub page problem
-
Hi there,
I want to do the following,
if a user clicks on a page that is a sub-page of a top level parent page, then page.php should call a certain header. If the parent page is different then a different header is called.
There are only two top level pages that I want this to happen on, so using the code from the codex page I tried this,<?php if (is_page() || $post->post_parent=="65") { $subpagefix="/header-resources.php"; } elseif (is_page() || $post->post_parent=="221") { $subpagefix="/header-quickref.php"; } else { $subpagefix="/header.php" ; // Fall-through } ?> <?php include (TEMPLATEPATH . $subpagefix ); ?>
So this seems to work for the page 65, but subpages of page 221 call the header-resources.php.
What have i done wrong?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Sub page problem’ is closed to new replies.