Skip to content

Instantly share code, notes, and snippets.



Last active May 24, 2016
What would you like to do?
How to show books in ascending order of published date when using Genesis Author Pro plugin.
add_action( 'pre_get_posts', 'sk_change_books_order' );
* Change display order of books on the archive from DESC to ASC
* @author Bill Erickson
* @link
* @param object $query data
function sk_change_books_order( $query ) {
if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'books' ) ) {
$query->set( 'order', 'ASC' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.