Support » Fixing WordPress » Only List 2nd level pages, not 1st or 3rd

  • Resolved mitchrenton

    (@mitchrenton)


    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try using the child_of parameter with wp_list_pages.

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

    esmi, that’s not the solution!

    ikramy

    (@ikramy)

    <?php
    $string = wp_list_pages('title_li&echo=0');
    if (preg_match('#^.*?<ul>.*?<ul>.*?(\s*<ul>.*?</ul>)#is', $string, $matches))
    {
        echo $matches[1]."\n";
    }
    
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only List 2nd level pages, not 1st or 3rd’ is closed to new replies.