Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Created December 16, 2014 15:06
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 leepettijohn/36a735190bc536e48e2b to your computer and use it in GitHub Desktop.
Save leepettijohn/36a735190bc536e48e2b to your computer and use it in GitHub Desktop.
Alphabetize
//Alphabetize the products
function modify_query_order( $query ) {
$cat = the_category_ID($echo=false);
if (is_category(8) || cat_is_ancestor_of(8,$cat)){
global $query_string;
query_posts($query_string."&order=ASC&orderby=title");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment