Skip to content

Instantly share code, notes, and snippets.

@robneu
Last active December 19, 2015 10:29
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 robneu/5941074 to your computer and use it in GitHub Desktop.
Save robneu/5941074 to your computer and use it in GitHub Desktop.
Reverse the post order on the page_blog.php template on the Genesis Framework.
<?php
add_filter( 'genesis_custom_loop_args', 'prefix_reverse_blog_template_order' );
/**
* Reverse Post Order on the page_blog.php
* template on the Genesis Framework
*
* @author FAT Media
* @link http://youneedfat.com/reverse-post-order-genesis-framework/
*
*/
function prefix_reverse_blog_template_order ( $args ) {
// Only change the args for the blog template.
if ( is_page_template( 'page_blog.php' ) ) {
$args['orderby'] = 'date';
$args['order'] = 'ASC';
return $args;
}
}
@robneu
Copy link
Author

robneu commented Jul 6, 2013

A full explanation of this code as well as some context for why it might not be such a great idea can be found on our blog: How to reverse the post order using the Genesis Framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment