Changeset 3549

Show
Ignore:
Timestamp:
02/19/06 02:07:13 (3 years ago)
Author:
ryan
Message:

Add alpha sort to wp_get_archives(). Props skippy. fixes #247

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/template-functions-general.php

    r3548 r3549  
    371371                } 
    372372        } 
    373     } elseif ( 'postbypost' == $type ) { 
    374         $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); 
     373    } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { 
     374        ('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC "; 
     375        $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY $orderby $limit"); 
    375376        if ( $arcresults ) { 
    376377            foreach ( $arcresults as $arcresult ) {