Changeset 4138
- Timestamp:
- 08/30/2006 05:23:42 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r4134 r4138 333 333 } 334 334 } 335 } elseif ('yearly' == $type) { 336 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts WHERE post_type ='post' AND post_status = 'publish' GROUP BY YEAR(post_date) ORDER BY post_date DESC" . $limit); 337 if ($arcresults) { 338 $afterafter = $after; 339 foreach ($arcresults as $arcresult) { 340 $url = get_year_link($arcresult->year); 341 if ($show_post_count) { 342 $text = sprintf('%d', $arcresult->year); 343 $after = ' ('.$arcresult->posts.')' . $afterafter; 344 } else { 345 $text = sprintf('%d', $arcresult->year); 346 } 347 echo get_archives_link($url, $text, $format, $before, $after); 348 } 349 } 335 350 } elseif ( 'daily' == $type ) { 336 351 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
Note: See TracChangeset
for help on using the changeset viewer.