How to exclude a particular category in wordpress using category name?
you can exclude a category from your posts by doing this code:
<?php $query_posts(‘cat=-4′); ?>
but i want to replace category ID with its category name. How do i do that?
can anyone help me please.
August 24, 2010 | Filed Under WordPress
Comments
2 Responses to “How to exclude a particular category in wordpress using category name?”
Powered by Yahoo! Answers
Didn’t test it but one of the paramenters you can use is category_name and the – means exclude. So you should be able to do something like.
query_posts(‘category_name=-Your Category Name’);
I believe you need to use the cat id, but I don’t know for sure. Best bet is to ask at the wordpress.org forums. Someone there can definitely tell you yes or no, as opposed to folks guessing.
http://wordpress.org/support/