Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mag_front_page_filter( $query ) {
- if ( $query->is_home() && $query->is_main_query() ) {
- if ( !get_query_var( 'issue' )){
- $tax_query = array(
- array(
- 'taxonomy' => 'issue' ,
- 'field' => 'slug',
- 'terms' => mag_get_current_issue(),
- )
- );
- $query->set( 'tax_query' , $tax_query);
- }
- }
- }
- // register the filter
- add_action( 'pre_get_posts', 'mag_front_page_filter' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement