Discluding pages from sidebar – categories
-
Please check out: this link and click on ‘about’ or ‘blog’. Please do not mind the lay-out, I am tinkering with it, and will ofcourse add my own colors and touches!
When you go to about, in the sidebar you first see the parent page and subpages, if there are any. I used the code
<ul><?php if($post->post_parent){ $parent=get_post($post->post_parent); $children = '<li><a href="'.get_permalink($post->post_parent).'">'.$parent->post_title.'</a></li>'; $children .= wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); }else{ $children = '<li><a href="'.get_permalink($post).'">'.$post->post_title.'</a></li>'; $children .= wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); } echo $children; ?> </ul>
When you look lower, you see some other things as well: categories and archives.
The code here is:
<h2>Categories</h2> <ul> <?php wp_list_cats('sort_column=name&optioncount=0'); ?> </ul> </div> <div style="margin-bottom:10px;"> <h2>Archives</h2> <ul> <?php get_archives(); ?> </ul> </div>
What I want, is to have the archives and categories only appear on my parent page called blog. How do I do this? On the other pages, it shouldn’t appear! I hope anyone knows
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Discluding pages from sidebar – categories’ is closed to new replies.