How To Query For An Empty Taxonomy Field

Thanks to Sally for the answer, which is to use the NOT EXISTS operator: $args = [ ‘post_type’ => ‘post’, ‘tax_query’ => [ ‘relation’ => ‘AND’, [ ‘taxonomy’ => ‘areaoflondon’, ‘field’ => ‘name’, ‘terms’ => ‘South London’, ‘include_children’ => false, ], [ ‘taxonomy’ => ‘yearofvisit’, ‘operator’ => ‘NOT EXISTS’ ] ], ‘posts_per_page’ => 5, ‘meta_key’ … Read more

Question about link two types of data in wordpress

I hope you have already created custom post types for Architects and Projects. In order to make a relation between them you may follow any of the methods below: a.) Using ACF: https://www.advancedcustomfields.com/resources/bidirectional-relationships/ b.) Using Toolset: https://toolset.com/2018/07/how-to-create-post-relationships-between-your-custom-post-types-and-how-to-display-them/ c.) Using Posts to Posts plugin (Use it at your own risk as the plugin hasn’t been tested … Read more

Use get_cat_ID to retreive multiple category IDs

$category_in = array(); foreach($topicsofinterest as $topicofinterest){ //Chaneg ‘category’ to the taxonomy name. $term = get_term_by( ‘name’, $topicofinterest, ‘category’); $category_in[] = $term->term_id; } Just curious, why don’t you store the category ID instead of category name in user meta?