I need to get the ID posts for which the category(taxonomy "category") is not specified. Post include other taxonomy.
I get posts from code:
$posts = $wpdb->get_results('SELECT ...', , ARRAY_A);
My query selects the desired type of recording
SELECT distinct posts.ID FROM wp_posts AS posts
LEFT JOIN wp_term_relationships AS cat_link ON
cat_link.object_id = posts.ID
LEFT JOIN wp_term_taxonomy AS cat_tax ON
cat_link.term_taxonomy_id = cat_tax.term_taxonomy_id AND cat_tax.taxonomy NOT IN ('category')
WHERE post_type = 'popular_music' AND post_status = 'publish' ORDER BY posts.ID DESC
But it is not considered:
cat_link.term_taxonomy_id = cat_tax.term_taxonomy_id AND cat_tax.taxonomy NOT IN ('category')
How to select the record, Uncategorized?