Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="sidebar">
- <!--<div class="widget">
- <?php
- $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
- if ($children) { ?>
- <ul>
- <?php echo $children; ?>
- </ul>
- <?php } ?>
- </div>-->
- <div class="widget">
- <ul>
- <?php
- // If CHILD_OF is not NULL, then this page has a parent
- // Therefore, list siblings i.e. subpages of this page's parent
- if($post->post_parent){
- wp_list_pages('title_li=&include='.$post->post_parent);
- wp_list_pages('title_li=&child_of='.$post->post_parent);
- }
- // If CHILD_OF is zero, this is a top level page, so list subpages only.
- else{
- wp_list_pages('title_li=&include='.$post->ID);
- wp_list_pages('title_li=&child_of='.$post->ID);
- }
- ?>
- </ul>
- </div>
- <?php $sidebar = is_page() ? 'page' : 'blog' ?>
- <?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar)): ?>
- <!-- Static sidebar items -->
- <?php endif; ?>
- </div>
- </div>
- <div class="clear"></div>
Add Comment
Please, Sign In to add comment