Here is my website structure(wordpress pages)
- HOME - - Tutorial - + PHP Tutorial + + Photoshop Tutorial + + Css Tutorial + + HTML Tutroial + - news - + November + September + May + April - about - - contact - How do I have the output just the pages which have children pages? so when I click tutorial page, the tutorial page has following list. (but pages list stays static when click subpages.
- Tutorial -
- PHP Tutorial +
- Photoshop Tutorial +
- Css Tutorial +
- HTML Tutroial +
I am using this code, but this only displays all children pages no parent.
<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=1"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?>