WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Only List 2nd level pages, not 1st or 3rd (4 posts)

  1. mitchrenton
    Member
    Posted 5 years ago #

    Hi,

    I thought this would be simple but I just can't seem to pull it off. I have 3 levels of pages, Parent, Child, Grandchild. I just want to display the 2nd level pages, ie, child pages.

    Can anybody point me in the right direction here?

    Thanks,

    Mitch

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Try using the child_of parameter with wp_list_pages.

  3. ikramy
    Member
    Posted 4 years ago #

    That is a big issue to me as well. I want a solution ;(

    esmi, that's not the solution!

  4. ikramy
    Member
    Posted 4 years ago #

    <?php
    $string = wp_list_pages('title_li&echo=0');
    if (preg_match('#^.*?<ul>.*?<ul>.*?(\s*<ul>.*?</ul>)#is', $string, $matches))
    {
        echo $matches[1]."\n";
    }
    
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic