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

git-svn-id: http://svn.automattic.com/wordpress/trunk@3549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-02-19 02:07:13 +00:00
parent 941ec0ff97
commit 35c2833427
1 changed files with 3 additions and 2 deletions

View File

@ -370,8 +370,9 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
} }
} }
} }
} elseif ( 'postbypost' == $type ) { } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); ('alpha' == $type) ? $orderby = "post_title ASC " : $orderby = "post_date DESC ";
$arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY $orderby $limit");
if ( $arcresults ) { if ( $arcresults ) {
foreach ( $arcresults as $arcresult ) { foreach ( $arcresults as $arcresult ) {
if ( $arcresult->post_date != '0000-00-00 00:00:00' ) { if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {