My portfolio page is created using posts and is not a static page like the About page. I did this to easily add and remove entries and so that the page didn’t become too large. It will display a set number of entries like any other blog post page.
The portfolio entries are in the category, portfolio. The code on the portfolio is set to only display that category.
I also use the Ultimate Category Excluder plugin so that the category does not display in my archives or in my rss feed. I’m hoping to spend some time on code based solution for that as well.
I realized that the Portfolio category was still showing up in the list of categories in the sidebar. I was using the Category Widget, because it’s easy, even though I’m not a big fan of widgets. The only way I could determine to exclude the category from the widget was by editing wp-includes/widget.php. For a brief moment that seemed like a really good idea. But every time I upgrade WordPress I would overwrite that file or I would have to save and redo my edits. So, not such a great idea after all.
Instead I used the list categories function and excluded the category that I didn’t want displayed. Here’s what I did:
- In Manage > Categories I hovered over the name of the category and got the id number that I wanted to exclude in the browser status bar. In this instance the number is 276.
- In Design > Widgets I removed the Category Widget and added a Text one.
- In the new text widget, I gave it the title Categories and added the following code:
<?php wp_list_categories('orderby=name&exclude=276&title_li='); ?>
- If you want to exclude multiple categories, put a comma between each ID number.
- If you don’t have a widgetized sidebar, you can add the code to your sidebar where your current archive code is located.
That’s all there is to it. I don’t know why it took me so long to notice it was in the list. I also don’t know why I was being a dunce about the solution; it’s very similar to excluding a page from the navigation bar.
Useful? Do you have a need for this? Do you think you will use it?
photo credit: felinebird
Did you enjoy this article? I can assist you with your WordPress or Facebook project. Contact me and I will provide you with an estimate. You can also connect with me on Facebook or follow me on Twitter. If you are looking for Hosting, WordPress Theme, Newsletter or other recommendations, please view my detailed list.