
Email This Post
How to hide sub-pages from sidebar
Wordpress, Blogging Tips July 20th, 2007
Visited 14636 times, 1 so far today If you have sub-pages on your sidebar that you want to hide then follow the simle easy steps below:Â
- Login to your WordPress administration panel
- Select Presentation ->Theme Editor from the navigation menu
- On the Theme Editor page, you will see a list of “theme files” to the right of the page. Select the “sidebar” (sidebar.php).
- Find the following line
wp_list_pages(’title_li=’); ?> - Replace it with the following line
<?php wp_list_pages(’depth=1&title_li=<h2>Pages</h2>’ ); ?>
This should work and should display only Pages that are not children, in other words it should hide ALL the children Pages.
Read the Comments
[ # 80 ] Comment from Farida [August 4, 2007, 12:20 pm]
[ # 167 ] Comment from matthew feldman [August 27, 2007, 12:45 am]


[ # 69 ] Comment from Garry Conn [July 28, 2007, 7:01 am]
Ok.. this is very close to what I have been looking for, but not quite.
I have a main page and then I have sub pages and these sub pages have sub-sub pages, and these sub-sub pages actually have sub-sub-sub pages.
From the main page, I want to display only the sub pages…
and from the sub-pages, I only want to display their own sub-sub pages.
and from the sub-sub pages, I only wan tto display their own sub-sub-sub pages.
How do I do that?