Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

this might sound like a very stupid question, and I am almost ashamed to put it here... however, after using the code straight from wp codex, and trying a couple of other variations from googling around, i simply have NO IDEA why this is not working!

here's what i am using for the wp query on the index.php

$args = array(
    'post_type' => array('photographs', 'published_works'),
    'meta_key' => 'place',
    'meta_value' => 'usa',
    'posts_per_page' => '-1'
);

i set up a custom taxonomy called 'place', and 'usa' is one of the terms. i can get to the archive page easily, but if i want to filter it out in the index page, it simply shows no posts at all.

so, i am assuming that the mistake is probably elsewhere, since the code above is taken straight from codex. any ideas of what i might be doing wrong???

much appreciated!

share|improve this question
add comment

closed as too localized by Rarst Jun 16 '13 at 15:14

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 2 down vote accepted

Taxonomies and meta data (Custom Fields) are two different things. If you want to filter on a taxonomy term, you want a tax_query, not a meta query.

share|improve this answer
    
THANKS!! I feel very stupid now :) –  Daniel Boccato Jun 16 '13 at 3:18
add comment

Hmm, I think you want to use Taxonomy Query (you have to set up a custom taxonomy, so it has nothing to do with custom fields) and not a Meta/Custom Field Query.

share|improve this answer
    
Maybe you want to elaborate why this helps and show a brief example. So far it should be a comment. –  kaiser Jun 16 '13 at 13:05
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.