I have a custom post called 'account' and custom taxonomy called 'bank';
What I'm trying to do is to show with wp_query post a list of post that should have a specific custom fields named 'tax'.
But I want in the result list of posts, only one post (for example the last) for each categories of my custom taxonomy.
My code is:
$query = new WP_Query ( array(
'showposts' => 5,
'post_type' => 'account',
'meta_key' => 'other_custom_field',
'orderby' => 'meta_value_num',
'order' => 'desc',
'meta_query' => array(array('key' => 'tax','compare' => '=','value' => 0)), ) );
This code works but it shows all post with same custom fields 'tax' contained in each category of custom post.
I want to show only one post for each categories, with this value of custom field.