parent and child page woes
-
I have been trying to figure a solution for quite sometime without having to make more template pages regarding displaying sub pages when you are within a parent section. I also would like those children to stay up if you are viewing one of its siblings. I’ve tried a few things I found in the forums but have not had any luck, does anyone have any examples?
you can see what i am trying to attempt here.
DDphere is the code i am working with. i have tried to exclude the parents for the other pages but it doesn’t seem to work…I’m missing something.
<div id="mainNav"> <div id="demo"><a href="/demo-reel/"><span>DEMO REEL</span></a></div> <div id="commercial"><a href="/commercial/"><span>COMMERCIAL</span></a></div> <ul><?php if (is_page( )) { $page = $post->ID; if ($post->post_parent) { $page = $post->post_parent; } $children=wp_list_pages( 'echo=0&depth=&child_of=' . $page . '&title_li=' ); if ($children) { $output = wp_list_pages ('echo=0&depth=&child_of=' . $page . '&title_li='); } } echo $output; ?> </ul> <div id="docubites"><a href="/docubites/"><span>DOCUBITES</span></a></div> <ul><?php if (is_page( )) { $page = $post->ID; if ($post->post_parent) { $page = $post->post_parent; } $children=wp_list_pages( 'echo=0&depth=&child_of=' . $page . '&title_li=' ); if ($children) { $output = wp_list_pages ('echo=0&depth=&child_of=' . $page . '&title_li='); } } echo $output; ?> </ul> <div id="candy"><a href="/candy/"><span>CANDY</span></a></div> <ul><?php if (is_page( )) { $page = $post->ID; if ($post->post_parent) { $page = $post->post_parent; } $children=wp_list_pages( 'echo=0&depth=&child_of=' . $page . '&title_li=' ); if ($children) { $output = wp_list_pages ('echo=0&depth=&child_of=' . $page . '&title_li='); } } echo $output; ?> </ul> <div id="about"><a href="/about-us/"><span>ABOUT US</span></a></div> <div id="contact"><a href="/contact/"><span>CONTACT</span></a></div> </div>
Thanks for any guidance.
kmaier
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘parent and child page woes’ is closed to new replies.