Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Excerpts, Read more, Pagination »

[SOLVED] Order Posts by Modified Date


  #1  
Old Aug 20, 2009, 04:00 AM
ysbwriel2k
 
3 posts · Aug 2009
Hi guys,

I'm hoping someone can point me in the right direction for editing the loop in the Atahualpa theme

I'd like to order ALL the posts on my blog - www.ddwt.co.uk - by date modified order, but can't find the relevant code in the loop (or the loop for that matter!) to add the 'orderby=modified' code to.

I'm using WP 2.8.4 and Atahualpa 3.4.1

Can someone help me please?

Thank you
  #2  
Old Aug 20, 2009, 05:55 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The code you are looking for is in the WordPress base code. While Atahualpa does set up some of the SQL selects (populat posts, popular in category), it relies on the normal 'loop' code in WordPress to retrieve posts.

You will have to look into the Wordpress code - you can search for 'FROM $wpdb->posts' - to find the code that does the select and change the 'order by'.

You also might try looking to see if there is a plugin that which will change the order
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Aug 20, 2009, 07:17 AM
ysbwriel2k
 
3 posts · Aug 2009
Hi Juggledad,

Thanks for the prompt reply

I tried as you suggested, but couldn't find the 'FROM $wpdb->posts' string anywhere unfortunately.

Isn't there any way of doctoring this bit:

PHP Code:
<?php /* The LOOP starts here. Do this for all posts: */
    
while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
So that it can include something like:

PHP Code:
<?php if (have_posts()) { $posts query_posts($query_string '&orderby=modified&order=desc'); } ?>
I'm very much a WP and PHP newbie, so could be talking out of my backside
  #4  
Old Aug 21, 2009, 02:36 PM
ysbwriel2k
 
3 posts · Aug 2009
Yay - I finally got it to work

So just for the sake of completeness, here's the solution (to my original request). Simply place this code:

PHP Code:
<?php query_posts($query_string '&orderby=modified&order=desc'); ?>
BEFORE this code in the MAIN index.php file (which you can edit directly via Wordpress):

PHP Code:
<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] == 0/* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>
Hope it helps someone else

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
my-category-order plugin order by 'order' not working darrenk Page & Category Menu Bars 3 Mar 24, 2010 07:56 AM
Posts display in reverse order? WayneEarl Installing & running WordPress 1 Aug 10, 2009 05:38 AM
The order of the header's rows and... ahc Header configuration & styling 2 Jun 2, 2009 03:54 PM
Pages Order in Sidebar gradlebum Atahualpa 3 Wordpress theme 3 May 29, 2009 04:07 PM
The %date-modified('F jS, Y')% in post footer not working Glottis Post-Kicker, -Byline & -Footer 11 Apr 11, 2009 05:52 AM


All times are GMT -6. The time now is 03:23 PM.


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