S
S
Socrates2018-02-26 16:41:22
WordPress
Socrates, 2018-02-26 16:41:22

Deriving CPTs that belong to a certain category in a taxonomy?

Created CPT(custom post type) and taxonomy for it. In taxonomy created several categories.
How to display posts from CPT that belong to a certain category?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Socrates, 2018-02-27
@Karmov69

$mypost = array(
'post_type' => 'my_post-type',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'my_taxonomy',
'field' => 'slug ',
'terms' => 'Taxonomy label'
)
),
);

M
Maksym Davydchuk, 2018-02-26
@maksym1991

Via wp_query with taxonomy parameters

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question