WordPress.org

Ready to get started?Download WordPress

Forums

Listing subpages (1 post)

  1. 25KGBOX
    Member
    Posted 6 years ago #

    how do i list the subpages in the parent page itself? I would like the parent page to be somewhat of a 'table of contents' the contents being the subpages.

    also, how can i alter the following `
    <?php
    $thispage = $wp_query->post;
    if($thispage->post_parent!=0)
    {
    wp_list_pages("title_li=&child_of=".$thispage->post_parent);
    }
    else
    {
    wp_list_pages("title_li=&child_of=".$thispage->ID);
    }
    ?>
    `
    so that when i click A i get A1 and then when i click A1 i get A1a

    [no page selected]
    A
    B
    C
    D

    to

    A[page A is selected]
    -A1
    B
    C
    D

    to

    A
    -A1[page A1 is selected]
    --A1a
    B
    C
    D

    etc..?

Topic Closed

This topic has been closed to new replies.

About this Topic