Skip to content

Instantly share code, notes, and snippets.

@rickrduncan
Created April 25, 2014 10:37
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 rickrduncan/11285035 to your computer and use it in GitHub Desktop.
Save rickrduncan/11285035 to your computer and use it in GitHub Desktop.
Order WordPress archive posts by "Title" in "Ascending" order for one specific category.
<?php
//* Do NOT include the opening php tag
function b3m_before_loop () {
if( is_category( '1' ) ) {
global $query_string;
query_posts( wp_parse_args( $query_string, array( 'orderby' => 'title', 'order' => 'ASC' ) ) );
}
}
add_action( 'genesis_before_loop', 'b3m_before_loop' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment