I’m trying to modify a plugin that generates an archive listing so it shows only one category, making it a single category archive.
The old version of the plugin used a get_posts query, and so it was easy to disallow categories of posts:
$rawposts = get_posts( 'numberposts=-1&category=-4,-6,-7,-9' );
The new version of the plugin uses that database query:
SELECT ID, post_date, post_date_gmt, comment_status, comment_count FROM
$wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' AND post_password =
How do I disallow several categories from a database query?
You could use the get_tax_sql() function introduced in WP 3.1:
(not tested)