Exclude multiple categories in the single post template
Note that this is so outdated already and is no longer applicable to WP 2.x
One of the hurdles I faced when integrating my portfolio and the update thingy into my site is regarding wordpress’ single post template. What I wanted to do is for my portfolio and my blog posts to be seperated especially whenever I view the single posts. I want to retain the next/prev post links but I want to exclude my portfolio category.
I searched the wordpress codex and support forums as well as the web for the possible solution and thankfully, I found it. Here are the steps to do.
- Your original wordpress installation does not allow the exclusion of categories in the single post template that’s why you have to implement this fix that Matt made into your template-functions-links.php file within the WP-includes folder. After that you will be able to exclude any categories that you want to hide, however there’s a glitch. You wouldn’t be able to exclude multiple categories so read on.
- You have to create a parent category and include all of the categories that you want to hide within that category (I’m so redundant, I know! But you get the drift, right?).
- Then follow the instructions on how to exclude a single category. (I know it says previous post link but it is also applicable to the next post link.) Put the ID of the parent category in place of the excluded category and voila! The category will no longer be linked to in your single posts.
However, I just want to let you know that just because you were able to exclude the said category in your single post it doesn’t mean that they will not appear in your archives. If you also want to exclude them in your archives then I suggest that you use Rich Hamiltons’ Category Visibility Plugin. Works like charm.
Had about the same problem configuring wordpress to work on my blog. Good thing you fixed it! =)
Was reading your “About” page and… did you just say you had a fling with Hugh Jackman?! My, my… that man sure gets around… and I thought he had a fling with me! :lol: ^_^
sweet hack!
thanks! :)
Thank You