How to reverse the post order using the Genesis Framework

OK, first let me say “WOW”.  Trying to find this information literally took me over an hour but I finally pieced it all together.  You would think that the solution would be so easy to find.  I just wanted to reverse the order output.

I found a ton of different ways to do it, the only problem was, NONE OF THEM WORKED!!!

But I figured it out finally… so here’s the code =)

[code language=”php”]
add_action(‘genesis_before_loop’, ‘child_before_loop’);
function child_before_loop () {
global $query_string;
query_posts($query_string . "&order=ASC");
}
[/code]

You can actually edit any part of this code once you know the variable to put in.

For example if you wanted it in ascending order based on the title, you would do something like this:

[code language=”php”]
add_action(‘genesis_before_loop’, ‘child_before_loop’);
function child_before_loop () {
global $query_string;
query_posts($query_string . "&order=ASC&orderby=title");
}
[/code]

So in conclusion you can pretty much edit the entire query string based on this code. Thank GOD!!

Oh yeah… and the best part is:

THIS WILL WORK ON ANY CHILD THEME!!!!!

Enjoy!

Focus on what matters!

Focus on what matters!

No more wasting time trying to figure out how to code it all!  Sign up below and I'll share my tips and tricks on how to build websites fast, professionaly, and with minimum code!

You have Successfully Subscribed!