i need your help :)
I've made this custom Mysql query on WordPress:
$querystr = "
SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE post_id IN(
SELECT DISTINCT wpostmeta.post_id
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
WHERE wposts.ID = wpostmeta.post_id
AND wpostmeta.meta_key = 'color'
AND wpostmeta.meta_value = 'red'
AND wposts.post_type = 'post' ) AND meta_key ='size'
ORDER BY RAND()
LIMIT 4
";
How can i ADD in the query search for "Category name" or "Category ID" ?
Cheers ;)