After spending most of the day looking for solutions and trying them out, I decided to explain my problem here.
I am aware that this subject has been covered and as you will see I am using code that has been suggested here and over at ottopress, but I still cannot figure it out.
I have a custom post type called 'review' (non-hierarchical) I have a custom taxonomy called 'reviewcats' (hierarchical) I have a whole bunch of terms under the taxonomy of which 3 are main and the rest children:
- featured
- applications (containing children)
- games (containing children)
On my homepage template I am first showing the latest review (custom post type) that has the term 'featured' from the 'reviewcats' taxonomy. That review also contains the terms 'applications' and a child thereof.
Under the Feature I would like to show the 10 most recent reviews (custom post type), but not the one from above, the one with the term 'featured'
I have been trying with the code below (and many variations of it), but cannot get it right. Can anyone shed light on this dark matter for me please? Much appreciated!
$recentapps_query['tax_query'] = array(
'relation' => 'AND',
array(
'post_type' => 'review',
'post_status' => 'publish',
'posts_per_page' => 10,
),
array(
'taxonomy' => 'reviewcats',
'terms' => array('featured'),
'field' => 'slug',
'operator' => 'NOT IN',
),
);
query_posts($recentapps_query);
if needed, the sandbox site is http://senl.in/jOaalP