Advertisement
marenm

add contextual subpages

Mar 15th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. function add_contextual_subpages() {
  2.  
  3. if($post->post_parent)
  4. $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
  5. else
  6. $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
  7. if ($children) { ?>
  8. <ul>
  9. <?php echo $children; ?>
  10. </ul>
  11. <?php };
  12.  
  13.  
  14. }
  15.  
  16. add_action('thematic_abovepost', 'add_contextual_subpages')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement