if post_parent…echo page title
-
Ok. I am probably just tired. But I have this code below for a sub-menu to appear on the sidebar when a certain top-page is selected. But I want to make it conditional since only two top pages have children. Anyone able to guide me for a wrapper on this one?
<li class="box"><h4><?php echo $post->post_title ?></h4> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <div id="children0"> <ul> <?php echo $children; ?> </ul> </div> <?php } ?> </li>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘if post_parent…echo page title’ is closed to new replies.