Make WordPress Core

Changeset 3549


Ignore:
Timestamp:
02/19/2006 02:07:13 AM (19 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 ) {
Note: See TracChangeset for help on using the changeset viewer.