Advertisement
Guest User

Wordpress Parent / Children

a guest
Apr 30th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <div id="leftNavContainer">
  2. <?php
  3. if ($post->post_parent !== 0) {
  4. $args = 'child_of=' . $post->post_parent;
  5. $CategoryName = get_the_title($post->post_parent);
  6. }
  7. else {
  8. $args = 'child_of=' . $post->ID;
  9. $CategoryName = get_the_title($ID);
  10. }
  11. $parent_link = get_permalink($post->post_parent);
  12.  
  13. echo"<div class='leftNavInnerContainerHeader'><a href='".$parent_link."'>". $CategoryName ."</a></div>";
  14. echo"<div id='leftNavInnerContainerBody'>";
  15. echo"<ul>";
  16. $children = wp_list_pages($args . '&title_li=&depth=1');
  17. echo"</ul>";
  18. echo"</div>";
  19.  
  20. ?>
  21. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement