WP_Query with two post types, but requiring category on only one of those post types


I have a simple WP_Query:

$loop = new WP_Query(array( 
      'post_type' => array('image', 'video'), 
      'category_name' => $cat, 
      'orderby'=>'date meta_value_num'

How can I alter this so that it return only videos with the tag editor-pick while still returning all images regardless of tags?

I’m looking for a filter to add onto the MySQL query so that order and pagination remain intact.

jetlej 5 months 0 Answers 55 views 0

Leave an answer