I'm trying to make a list of posts that are in one category (let's say my_category) and also have one tag added (my_tag). I tried this:
$args = array(
'category_name' => 'my_category',
'tag' => 'my_tag'
);
$my_posts = get_posts($args);
but it returns nothing. If I put only one argument (either category_name or tag) I get all the right posts.
Why can't I use those both arguments?
No one else needs this?
Well I managed to get this working with own custom query and couldn't help noticing how complicated wordpress-database structure is. Why tags and categories doesn't have their own tables? This wp_terms, wp_term_relationships & wp_term_taxonomy structure is making queries quite complex.
Anyway I think this really should be working with standard get_posts() -function. Hope this will be fixed.
WordPress's query system does not support the combination of categories and tags at present. Version 2.7 may fix this.