Forums

fold_page and wp_list_page won't display child page only (4 posts)

  1. wildhorses
    Member
    Posted 3 years ago #

    Objective: display parent and child pages of the current page only.
    When I try:
    <?php wswwpx_fold_page_list ($arglist); ?>
    I get a full listing of all the parent and child pages site wide.

    When I try:

    <?php
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
    if ($children) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
    <?php } ?>

    I get nothing.

    I tried fold_page too.

    <?php wswwpx_fold_page_list ($arglist); ?>

    This displayed all parent pages site wide but no child pages.

    I tried a modification I found somewhere that was supposed to show only the current parent and its children but that, as with wp_list_pages displayed nothing. I can't find it to show here.

    It seems like there's something with my theme or set up of wp that might be causing it? I'm using a modified (by me) Ajax-Berlee.

  2. Xamataca
    Member
    Posted 3 years ago #

    <?php
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
    if ($children) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
    <?php } ?>

    You get nothing because you didn't change ID with your current ID(number) page. :-)

  3. wildhorses
    Member
    Posted 3 years ago #

    Thanks. A lot. I don't know what that means, obviously.

    What ID? Where do I find the ID? I am putting this in the sidebar--do I need a different side bar template for each parent page--ID? where I want to show this kind of menu?

    Your tolerance is appreciated!

  4. Xamataca
    Member
    Posted 3 years ago #

    A nice read for you ;-)
    http://codex.wordpress.org/wp_list_pages
    Look at the examples provided.

Topic Closed

This topic has been closed to new replies.

About this Topic