Last active
December 19, 2015 10:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.