I have the following custom query and I would like to add the functionality to also search by category. Can someone help me with the code to add?
SELECT $wpdb->posts.* FROM $wpdb->posts
WHERE $wpdb->posts.post_status = ‘publish’
AND $wpdb->posts.post_type = ‘page’
AND $wpdb->posts.post_date > ‘”.$wbc_new_date_start.”‘
AND $wpdb->posts.post_date < ‘”.$wbc_new_date_end.”‘
ORDER BY $wpdb->posts.post_date ASC
- The topic ‘Display Posts By Category’ is closed to new replies.