Posted By

i-am-andy on 12/29/11


Tagged

sidebar nav wplistpages hierarchical


Versions (?)

Wordpress hierarchical sidebar nav


 / Published in: PHP
 

Wordpress hierarchical sidebar nav using wplistpages

  1. <?php
  2. if($post->post_parent) {
  3. $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order&exclude=88,93,91");
  4. $titlenamer = get_the_title($post->post_parent);
  5. }
  6.  
  7. else {
  8. $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&sort_column=menu_order&exclude=88,93,91");
  9. $titlenamer = get_the_title($post->ID);
  10. }
  11. if ($children) { ?>
  12.  
  13. <ul class="sidebar_nav">
  14. <?php echo $children; ?>
  15. </ul>
  16.  
  17. <?php } ?>

Report this snippet  

You need to login to post a comment.