Hi,
Using wordpress as a CMS and after spending far too much time implementing the "pretty" lava lamp functionality in the top nav menu I have hit a snag that is bothering me.
Essentially, if a user clicks on a page that is a sub-page of a top level parent page, then page.php needs to call a certain header. If the parent page is different then a different header is called.
This is to force the default location of the menu highlighting to stay on the parent page rather than defaulting back.
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 ); ?>
Admittedly, I am obsessing over a detail, but like I said, it took me so long to get the thing to work at the start, and it has become and important indicator of location for the user.
Hope someone can help.