Created
April 23, 2015 18:54
-
-
Save bradpotter/9084667a8ec826ec9dd6 to your computer and use it in GitHub Desktop.
Modify the main query based on tag
This file contains 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
//* Modify the main query based on tag | |
add_action( 'pre_get_posts','custom_tax_query' ); | |
function custom_tax_query( $query ) { | |
if ( $query->is_main_query() && $query->is_tag( 'west-valley-2015' ) ) { | |
$query->set( 'posts_per_page', '3' ); | |
$query->set( 'order', 'ASC' ); | |
$query->set( 'orderby', 'title' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment