Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 08-26-2009, 01:02 PM   #1
Cranky Old Man
War Room Member
 
KimW's Avatar
 
Join Date: Jul 2002
Location: Virginia,USA.
Posts: 1,253
Blog Entries: 1
Thanks: 2,030
Thanked 1,959 Times in 1,118 Posts
Social Networking View Member's FaceBook Profile 
Default Reversing the post order in Wordpress

Ive seen where it says to reverse the post order in wordpress to insert a line of code in the index.php file,but for the life of me I can't tell which index php file they mean. Can anyone help with the line of code and where the file is located?
Kim

KimW is online now   Reply With Quote
Old 08-26-2009, 02:18 PM   #2
Senior Warrior Member
War Room Member
 
Steve Diamond's Avatar
 
Join Date: Apr 2006
Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Steve Diamond
Default Re: Reversing the post order in Wordpress

Hi, Kim. I haven't tried it, but according to this post, here's the scoop:

Quote:
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( . "&order=ASC") ?>
The index.php file they're referring to is the one in your currently active theme folder, which is /wp-content/themes/yourthemename/.

Note that depending on how your theme is structured, this may not have the reversing effect on all kinds of pages of your blog. It should reverse the order on your home page, assuming that you're not showing a static page on your home page. But if you want the same effect on your categories, archives, or tags pages, you may have to make the same change in other files in your theme.

Hope this helps.

Steve

Executive I.T. consulting for small/medium business
Website development | PHP - MySQL - JavaScript expert programming
Software requirements analysis | Specification writing
Project management | Vendor relationship management
Steve Diamond is online now   Reply With Quote
Old 08-26-2009, 02:34 PM   #3
Cranky Old Man
War Room Member
 
KimW's Avatar
 
Join Date: Jul 2002
Location: Virginia,USA.
Posts: 1,253
Blog Entries: 1
Thanks: 2,030
Thanked 1,959 Times in 1,118 Posts
Social Networking View Member's FaceBook Profile 
Default Re: Reversing the post order in Wordpress

It's the posts I want in reverse order. I'm going to try it in a few minutes,thanks.
Kim

Edit:
Thanks Steve, I did it and it worked.
Its the wordpress site about my kidney listed in my sig,and making it reverse the post order makes it read a lot more coherently.
Kim

KimW is online now   Reply With Quote
Old 08-26-2009, 04:21 PM   #4
Senior Warrior Member
War Room Member
 
Steve Diamond's Avatar
 
Join Date: Apr 2006
Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Steve Diamond
Default Re: Reversing the post order in Wordpress

Great! I'm glad to know that it works.

Steve

Executive I.T. consulting for small/medium business
Website development | PHP - MySQL - JavaScript expert programming
Software requirements analysis | Specification writing
Project management | Vendor relationship management
Steve Diamond is online now   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
order, post, reversing, wordpress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 09:36 PM.