• I am trying to list the children of a specific parent page in my sidebar navigation, and I need a little help in defining the child_of parameter. Basically, this is the code I am using, and I wasn’t sure how to edit the PHP so that it only calls for the children of a specific parent. I assume that I need to specify it in the quotes following &child_of= but my limited PHP knowledge means that I’m not totally sure that this is where it would go, and if so, the proper way to write it. Thanks.

    <?php
    if($post->post_parent)
    $children = wp_list_pages(“sort_column=menu_order&title_li=&child_of=”.$post->post_parent.”&echo=0″);
    else
    $children = wp_list_pages(“sort_column=menu_order&title_li=&child_of=”.$post->ID.”&echo=0″);
    if ($children) { ?>

      <?php echo $children; ?>

    <?php } ?>

  • The topic ‘Listng Children of a Specific Parent’ is closed to new replies.