Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halgatewood/9350926 to your computer and use it in GitHub Desktop.
Save halgatewood/9350926 to your computer and use it in GitHub Desktop.
function hg_change_archive_order( $query )
{
if($query->is_archive AND $query->query['post_type'] == "testimonial")
{
$query->set( 'order' , 'asc' );
$query->set( 'orderby' , 'title' );
}
}
add_filter( 'pre_get_posts' , 'hg_change_archive_order' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment