Display subpages on your wordpress sidebar

November 1, 2008

If you use pages and subpages on your blog, it can be a good idea to use your sidebar to create a menu of subpages. If you’d like to try, the following code is what you need! In order to achieve this recipe, place the following code on your sidebar.php file. <?php $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'); if ($children) { ?> <ul> <?php echo $children; ?> </ul> <?php } ?> The above code executes the wp_list_pages function, with the echo=0... [Read the full story]

Page 3 of 3«123