Query two custom posts and two custom taxonomies
-
Hi All,
I am building a website which has multiple custom post types and taxonomies to keep everything organised.
The website has a carousel which should display posts from two custom post types (client & events). In addition to the post types the query should only display posts which have the tag “favourite” which is present in two custom taxonomies (tagevents & eventtags).
I am having trouble constructing a query to pull in the correct posts, as it stands I have:
<?php query_posts( array( 'post_type' => array('client', 'events'), 'tax_query' => array('tagevents' => 'favourite', 'eventtags' => 'favourite' ) ) ); ?>
This seems to be pulling in posts from the ‘events’ post type only whilst ignoring the “favourite” tag, any ideas?
Many thanks in advance for your help,
Lewis.
- The topic ‘Query two custom posts and two custom taxonomies’ is closed to new replies.