WordPress.org

Ready to get started?Download WordPress

Forums

query_posts beyond codex (2 posts)

  1. mamulea
    Member
    Posted 1 year ago #

    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.

  2. vtxyzzy
    Member
    Posted 1 year ago #

    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/

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic