Title: query_posts beyond codex
Last modified: August 20, 2016

---

# query_posts beyond codex

 *  [mamulea](https://wordpress.org/support/users/mamulea/)
 * (@mamulea)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/query_posts-beyond-codex/)
 * Hello. What I need to do is a custom query_posts to retrieve posts either from
   a tag **or** a custom field. I suspect I should use `'relation' => 'OR'` between
   a _tax\_query_ array and _meta\_query_ array, but it seems that those two are
   somewhat not compatible.

Viewing 1 replies (of 1 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/query_posts-beyond-codex/#post-3387899)
 * I believe that what you want will require the use of filters to modify the query.
   Here is an article that gives a very basic description of such filters: [http://wordpress.mcdspot.com/2010/05/30/filters-to-modify-a-query/](http://wordpress.mcdspot.com/2010/05/30/filters-to-modify-a-query/)
 * If you can use phpMyAdmin or a similar tool to create a query that works, you
   can use the filters to modify the query_posts() query to match.
 * My guess is that you will need to start with a very basic query_posts() query
   and add ‘LEFT JOIN’s for the other tables needed.

Viewing 1 replies (of 1 total)

The topic ‘query_posts beyond codex’ is closed to new replies.

## Tags

 * [meta_query](https://wordpress.org/support/topic-tag/meta_query/)
 * [tax_query](https://wordpress.org/support/topic-tag/tax_query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/query_posts-beyond-codex/#post-3387899)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
