How to retrieve more posts from a custom post type that are in the same category as the current post

The site I’m working on is using a plugin IssueM that created a custom post type called article, and has a custom taxonomy called issuem_issue_categories that has categories such as boat-profile, product-reviews, technique, etc. There are then posts within the article post type of course, and they are in those categories.

Further down the page I am trying to show more posts that are in that same category, but with the query below, I am only getting back ‘regular’ posts from the built in wordpress post type. I have tried a bunch of different queries, but just cannot get it to return what I need…

<?php
$args = array (
array(
‘post_type’ => ‘article’,

‘tax_query’ => array(
array(
‘taxonomy’ => ‘issuem_issue_categories’,
‘field’ => ‘slug’,
)
)
)
);
$query = new WP_Query( $args );

if( $query->have_posts() ) {
while( $query->have_posts() ) {
$query->the_post();
the_title();
}
wp_reset_postdata();

}

?>

Read more here:: How to retrieve more posts from a custom post type that are in the same category as the current post

Leave a Reply

Your email address will not be published. Required fields are marked *