Custom post type query with taxonomy

Answering your second question – yes, it is possible, you can use tax_query for this, for example, this query will get all posts that has any term of ‘flowers’ taxonomy AND ‘colors’ taxonomy: $query = new WP_Query( array( ‘post_type’ => ‘custom-post’, ‘posts_per_page’ => 5, ‘order’ => ‘DESC’, ‘tax_query’ => array( ‘relation’ => ‘AND’, // it … Read more

Display related CPT with custom taxonomy

I was building something similar a couple of years ago, here’s what I did, maybe it helps … (changed to your use case) $result = new WP_Query([ ‘post_type’ => ‘location’, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1, // all of them on one page ‘tax_query’ => [ [ ‘taxonomy’ => ‘services’, ‘field’ => … Read more