whyisjake

Jake Spurlock

Apr 26th, 2010
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <div class="sidebar">
  2.    
  3.     <!--<div class="widget">
  4.    
  5.         <?php
  6.             $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
  7.             if ($children) { ?>
  8.             <ul>
  9.             <?php echo $children; ?>
  10.             </ul>
  11.         <?php } ?>
  12.    
  13.     </div>-->
  14.    
  15.     <div class="widget">
  16.    
  17.         <ul>
  18.        
  19.             <?php
  20.             // If CHILD_OF is not NULL, then this page has a parent
  21.             // Therefore, list siblings i.e. subpages of this page's parent
  22.             if($post->post_parent){
  23.                 wp_list_pages('title_li=&include='.$post->post_parent);
  24.                 wp_list_pages('title_li=&child_of='.$post->post_parent);
  25.                 }
  26.             // If CHILD_OF is zero, this is a top level page, so list subpages only.
  27.             else{
  28.                 wp_list_pages('title_li=&include='.$post->ID);
  29.                 wp_list_pages('title_li=&child_of='.$post->ID);
  30.                 }
  31.             ?>
  32.        
  33.         </ul>
  34.    
  35.     </div>
  36.    
  37.     <?php $sidebar = is_page() ? 'page' : 'blog' ?>
  38.     <?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar)): ?>
  39.         <!-- Static sidebar items -->
  40.     <?php endif; ?>
  41.    
  42. </div>
  43.  
  44. </div>
  45. <div class="clear"></div>
Add Comment
Please, Sign In to add comment