From 35c2833427a606e5952133614ceff233917fa33a Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 19 Feb 2006 02:07:13 +0000 Subject: [PATCH] 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 --- wp-includes/template-functions-general.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/template-functions-general.php b/wp-includes/template-functions-general.php index f15569c46d..1efe9092e5 100644 --- a/wp-includes/template-functions-general.php +++ b/wp-includes/template-functions-general.php @@ -370,8 +370,9 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after } } } - } elseif ( 'postbypost' == $type ) { - $arcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit); + } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) { + ('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 ) { foreach ( $arcresults as $arcresult ) { if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {