Created
December 21, 2015 17:41
-
-
Save saxap/f543347c016ebad2d72b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// only published term | |
$args = array(); | |
$args['posts_per_page'] = 99999999999; | |
$args['post_type'] = 'ask'; | |
$args['tax_query'] = array('relation' => 'AND'); | |
$args['tax_query'][] = array( | |
'taxonomy' => 'qstatus', | |
'field' => 'id', | |
'terms' => array(19), | |
'operator' => 'NOT IN' | |
); | |
$not_published_ques = get_posts($args); | |
$not_ids = array(); | |
foreach ($not_published_ques as $que) { | |
$not_ids[] = $que->ID; | |
} | |
global $wp_query; | |
$args = array(); | |
$args['post__not_in'] = $not_ids; | |
query_posts(array_merge($args,$wp_query->query)); | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment