getting posts and events by tag using tax_query – how to make it work?
-
Hi,
I am trying to display featured events alongside featured posts on one page. The events are maintained using the “events manager” plugin. To flag posts or events as featured I want to use tags – not categories.
My apporach was the following:
$posts = get_posts( array( 'post_type' => array( 'event', 'post'), 'posts_per_page' => 9, 'orderby' => 'date', 'order' => 'DESC', 'tax_query' => array( array( 'taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => 'featured' ) ) ) ); }
This works for the posts, but not for the events. I assume it is because events manager uses its own taxonomy for it. But I can’t make it work and can’t find docu on the events manager taxonomy for this….
I tried:'taxonomy' => 'even_tag', 'field' => 'slug', 'terms' => 'featured'
'taxonomy' => 'even-tags', 'field' => 'tag_ID', 'terms' => '..THE ID..'
and many more variations, but nothing worked.
Any suggestions?
Help would be much appreciated! Thx!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘getting posts and events by tag using tax_query – how to make it work?’ is closed to new replies.