add_filter('pre_get_posts','better_editions_archive');
function better_editions_archive($query) {
if ( $query->is_tax( 'edition', 6 ) && $query->is_main_query() ) {
$query->set( 'post_type', array( 'post' ) );
'relation' => 'AND',
'taxonomy' => 'category',
'field' => 'id',
'terms' => array( 1, 2, 4, 5 )
),
'taxonomy' => 'edition',
'field' => 'id',
'terms' => array( 7, 8 ),
'operator' => 'NOT IN'
)
);
$query->set( 'tax_query', $tax_query_args );
}
return $query;
}
Posted by functions.php at 12 Mar 2013, 08:21:49 Europe/Berlin
Language: php