WordPress.org

Ready to get started?Download WordPress

Forums

query with multiple custom fields (2 posts)

  1. sierrajoe
    Member
    Posted 4 years ago #

    I am trying to use a wp_query with multiple custom field key/value pairs. From the results I get it seems that only one key/value pair is actually being used in the query. for example, with the argument:
    meta_key=post_group_head&meta_value=no&meta_key=post_group&meta_value=test
    I would have expected to only retrieve posts with post_group_head=no AND post_group=test.
    However, what I actually receive is posts with post_group=test and no filtering based on post_group_head.

    Is this expected? is there a way around it?
    Thanks,
    joe

  2. vtxyzzy
    Member
    Posted 4 years ago #

    The code I showed in this thread may help.

Topic Closed

This topic has been closed to new replies.

About this Topic