Reputation: 125
I'm using wp_query to build a list of posts from my CPT, however I need to filter this list by it's term, I can run a tax query which again is fine.
However I also need the term to be in the array of the query for each post.
Is this possible?
Upvotes: 2
Views: 72
Reputation: 458
i think you can you can use below code to show terms inside loop.
$term_list = wp_get_post_terms( $postId, 'my_taxonomy', array( 'fields' => 'all' ) );
Upvotes: 3