Vertical Submenu in Wordpress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. if($post->post_parent)
  3. $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
  4. $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  5.  
  6. if ($children && is_page()) { ?>
  7. <ul id="L2">
  8. <?php echo $children; ?>
  9. </ul>
  10. <?php } else { ?>
  11. <?php } ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.