• Resolved thapame

    (@thapame)


    I have one main page and lots of subpage. So my question is how I can list all sub pages on Parent Page with it’s link.

    any help??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Use the child_of parameter with the template tag, wp_list_pages().

    Thread Starter thapame

    (@thapame)

    mmm I am confused Can you post any example for it?

    You’ll need to create a Page Template and in that template, you want to put something like this to list the children of a page:

    <?php
    wp_list_pages('child_of=6'); ?>

    The above lists child pages of Page ID 6.

    Resources:
    Template Hierarchy
    Stepping Into Templates
    Stepping Into Template Tags
    Editing Files

    Thread Starter thapame

    (@thapame)

    I have created a new page template bios.php
    and the code on the page is:

    =============================================
    <?php
    /*
    Template Name: Bios
    */
    ?>
    <?php get_header(); ?>
    <!– Container –>
    <div class=”CON”>

    <!– Start SC –>
    <div class=”SC”>
    <?php include (TEMPLATEPATH . “/menu.php”); ?>

    <?php
    wp_list_pages(‘child_of=1263’);
    ?>

    </div>
    <!– End SC –>
    <?php get_sidebar(); ?>

    <!– Container –>
    </div>
    <?php get_footer(); ?>
    =============================================

    and now what I need to do?
    DO I have to create page and subpage? if so then How the page template would apply on created page?

    You do Manage->Pages and edit that page and assign the Page Template.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to add pages list on parent page’ is closed to new replies.