• Simple question here, how can one modify the wp_list_pages tag to only display third-level pages of the current parent item? I don’t want any pages nor subpages above the third level, just the third level ones. And yes, I have looked at the codex and i figured out the parameter &depth=””, but this parameter only defines how deep it goes down in displaying subpages. Is there any possibility to only show a certain depth of subpages? I came up with the idea to exclude certain depths but it won’t work for me?

    Right now I have:
    <?php if($post->post_parent)
    $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″); else
    $children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);
    if ($children) { ?>
    <ul id=”subnav”>
    <?php echo $children; ?>

    <?php } else { ?>
    <?php } ?>

    Thanks in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to show only third level page items via wp_list_pages()’ is closed to new replies.