show_post_count, after, and custom format were not playing nicely in get_archives.
git-svn-id: https://develop.svn.wordpress.org/trunk@1291 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7a85e8bfbf
commit
306ed77c67
@ -246,11 +246,12 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
|
|||||||
if ('monthly' == $type) {
|
if ('monthly' == $type) {
|
||||||
$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $tableposts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
|
$arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $tableposts WHERE post_date < '$now' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit);
|
||||||
if ($arcresults) {
|
if ($arcresults) {
|
||||||
|
$afterafter = $after;
|
||||||
foreach ($arcresults as $arcresult) {
|
foreach ($arcresults as $arcresult) {
|
||||||
$url = get_month_link($arcresult->year, $arcresult->month);
|
$url = get_month_link($arcresult->year, $arcresult->month);
|
||||||
if ($show_post_count) {
|
if ($show_post_count) {
|
||||||
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
|
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
|
||||||
$after = ' ('.$arcresult->posts.')';
|
$after = ' ('.$arcresult->posts.')' . $afterafter;
|
||||||
} else {
|
} else {
|
||||||
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
|
$text = sprintf('%s %d', $month[zeroise($arcresult->month,2)], $arcresult->year);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user