WP_Query get posts from custom posts by category
You’re using category query for your custom taxonomy. So it won’t work, because there are no categories with such IDs. You should use tax_query instead. // post types query while ( have_posts() ) { the_post(); // getting the categories $categoryIDs = array(); // it’s much nicer than concatenated string $getcategory = get_the_terms($post->ID, ‘custompostnamehere-categories’); foreach($getcategory as … Read more