Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Reverse post order (oldest first) without affecting static homepage (http://forum.bytesforall.com/showthread.php?t=12387)

tomsimone Jan 22, 2011 07:10 AM

Reverse post order (oldest first) without affecting static homepage
 
Hello,

Really hope someone can help me with this...

I want to reverse the order of the posts on my posts page.

I've tried this solution:
In your index.php file, look for this bit of code:

<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

Right before that line, add this code:

<?php query_posts($query_string . "&order=ASC") ?>
I also tried putting this line of code in ATO>center column>above loop.

The problem is that the static homepage starts displaying posts as well, rather than the static text I want it to.

Please could someone help me out with this?

Many thanks,

Tom

tomsimone Jan 22, 2011 09:40 AM

Any help much appreciated.

lmilesw Jan 22, 2011 09:56 AM

I wouldn't mess with the index.php file. You might want to try this plugin http://wordpress.org/extend/plugins/...ting-reloaded/

tomsimone Jan 22, 2011 03:04 PM

Hey, thanks so much for that link, I'd tried a few other plugins but was left frustrated.

With Post Sorting Reloaded the interface is very easy to understand with links to lots of documentation.

At first I tried is_MyCategory() as Condition 1 sorted by post_date ASC , but this made the whole site fail to load.

I then changed Codition 1 to is_home() for no good reason, and this worked.

These terms are obvious when you start using the plugin and I include what I did here in case it works for anyone else. I don't know the first thing about php.

Thanks again Larry.

lmilesw Jan 22, 2011 03:41 PM

You can also check here for the syntax for conditional tags. For instance if you wanted to sort the archive page for a category with an ID of 23 you would use the following.
HTML Code:

is_category('23')


All times are GMT -6. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.