Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

query('showposts='.$display_count.'&orderby=comment_count&category__not_in=14');

It wont exclude the category that i want. Posts still show up

share|improve this question
add comment

2 Answers

As far as I remember category__not_in takes array of IDs, which are pain to use when written as string.

For single category it would is easier to write it as cat=-14 (minus before ID).

See Category Parameters in Codex.

PS I think you meant query_posts(), not query()?..

share|improve this answer
    
Cool, thanks for the help! –  estern Dec 1 '10 at 21:57
add comment

example:

global $wp_query;           
$wp_query->set('cat', '-14,-1172,-867');
$posts = $wp_query->get_posts();
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.