开发者

Show Sub and Sub-Sub Pages in Sidebar

So, I have a Parent page with multiple Sub Pages. Some of the Sub Pages have Sub Sub Pages. I want to be able to, on the Parent page, only display all the Sub Pages. If you go to a Sub Page it will display all of the Parent's Sub Pages still, but now also display the Sub Sub Pages of the current Sub Page.

The current function I have now does almost that, but it's lacking. It will display all of the Sub Pages, if you go to a SUb Page, it will display the Sub Sub Pages, but if you get to the Sub Sub Page, it will only display all the other Sub Sub Pages, and stops displaying the Sub Pages.

<?php
  if($post->post_parent)
    $children = wp_list_pages("title_li=&sort_column=men开发者_JAVA技巧u_order&child_of=".$post->post_parent."&echo=0");
  else
    $children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0&depth=1");
  if ($children) { 
?>
  <ul>
    <?php echo $children; ?>
  </ul>
<?php } ?>

Does anyone have an idea of what I could try to make this work? This is a quick idea of how it should output.

*Parent Page* ( does not need to display anything, just a marker of the current page I am on )
  - Sub Page 1
  - Sub Page 2
  - Sub Page 3

*Sub Page 1* ( does not need to display anything, just a marker of the current page I am on )
  - Sub Page 1
    - Sub Sub Page 1
    - Sub Sub Page 2
  - Sub Page 2
  - Sub Page 3

*Sub Sub Page 1* ( does not need to display anything, just a marker of the current page I am on )
  - Sub Page 1
    - Sub Sub Page 1
    - Sub Sub Page 2
  - Sub Page 2
  - Sub Page 3


I think the Fold Page Plugin does what you want.


Thanks @Kalessin, but that plugin hasn't been updated since 2008.

I ended up using Simple Section Navigation Widget

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜