Answer the question
In order to leave comments, you need to log in
How to display custom post types associated with taxonomy (WordPress)?
The structure is like this:
global $wp_query;
// получаем текущий slug
$now_slug = $wp_query->query["catalogs"];
$args = array(
'post_type' => 'product',
'paged' => get_query_var('paged'),
'order' => 'ASC',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'catalogs',
'field' => 'slug',
'terms' => $now_slug
)
)
);
query_posts($args);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question