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.

I have a WP-Query which I pass post IDs to via

'post__in' => explode(',', $my_ids)

I then want the ability to refine this list by a custom field value (if present).

I have tried including the custom field test in the args for WP-Query but I get my ID list PLUS the custom field post IDs (instead of my IDs filtered by the custom field value).

I also tried adding a query_post after the WP-Query as a filter but that didnt work at all.

How can I filter the query further?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Have you tried using meta_query? More details at http://codex.wordpress.org/Class_Reference/WP_Query.

share|improve this answer
    
Thanks @Dee, I just found it!!! [wordpress.org/support/topic/… this link was very useful too. –  Gyro Oct 12 '11 at 12:14
    
Great to know that! –  dchucks Oct 12 '11 at 12:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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