Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created May 31, 2012 20:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/2846060 to your computer and use it in GitHub Desktop.
Save jaredatch/2846060 to your computer and use it in GitHub Desktop.
<?php
/**
* Tweak the query
*/
function ja_query_tweaks( $query ) {
if( $query->is_post_type_archive( 'program-partners' ) ) {
$query->query_vars['orderby'] = 'title';
$query->query_vars['order'] = 'ASC'; // Can be ASC or DESC
// $query->query_vars['posts_per_page'] = -1; uncomment to show ALL on first page
return;
}
}
add_action( 'pre_get_posts', 'ja_query_tweaks' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment