Add alpha sort to wp_get_archives(). Props skippy. fixes #247
git-svn-id: https://develop.svn.wordpress.org/trunk@3549 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
28961b459c
commit
ae48463e5d
@ -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' ) {
|
||||
|
Loading…
Reference in New Issue
Block a user