Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter rootboy03

    (@rootboy03)

    SOLVED

    If anyone wanna use the same code i used/editted.

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

    if statement: Shows the childeren of a page and if end page doesnt have childeren.

    Else: Show it from the last parent.

Viewing 1 replies (of 1 total)