• I’m having trouble finding some code that’ll get my subpages displaying as intended.

    I have a sitemap such as
    Page 1
    – Subpage 1
    – – Sub-subpage 1
    – – Sub-subpage 2
    – Subpage 2
    Page 2

    What i want is this:
    When you’re on Page 1, display links to Subpage 1 and Subpage 2
    When you’re on Subpage 1, display links to Sub-subpage 1 and Sub-subpage 2
    When you’re on Sub-subpage 1, display links to Sub-subpage 1 and Sub-subpage 2 still

    Can anyone help? To me this seems like something that should be simple/common but i can’t get seem to wrangle wp_list_pages into doing it!

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kurdt_the_goat

    (@kurdt_the_goat)

    Sorry, i forgot to add:
    If you’re on page 2, it should display nothing.

    Lots of the code i’ve tried tends to display links to Page 1, Page 2 etc in this scenario

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

    you can try this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sub pages problem’ is closed to new replies.