SELECT only certain categories
-
How do make this select statement NOT select posts from the category 3? I mean what is the syntax, I have tried everything. I have my category 3 displayed separately, this is for my list of the 10 most recent posts on my right column.
<?php $today = current_time('mysql', 1); if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_type='post' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 10")): ?>
I tried this:
AND post_category='photo_galleries
but no worky!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘SELECT only certain categories’ is closed to new replies.