Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Aug 20, 2009, 03: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, 04:55 AM
juggledad's Avatar
juggledad
 
21,713 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
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
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #3  
Old Aug 20, 2009, 06: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, 01: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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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 06:56 AM
Posts display in reverse order? WayneEarl Installing & running WordPress 1 Aug 10, 2009 04:38 AM
The order of the header's rows and... ahc Header configuration & styling 2 Jun 2, 2009 02:54 PM
Pages Order in Sidebar gradlebum Atahualpa 3 Wordpress theme 3 May 29, 2009 03:07 PM
The %date-modified('F jS, Y')% in post footer not working Glottis Post-Kicker, -Byline & -Footer 11 Apr 11, 2009 04:52 AM


All times are GMT -6. The time now is 08:28 AM.


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