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"); foreach ($yearsWithPosts as $currentYear) { for ($currentMonth = 1; $currentMonth <= 12; $currentMonth++) { $monthsWithPosts[$currentYear->year][$currentMonth] = $wpdb->get_results(" SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' AND year(post_date) = '$currentYear->year' AND month(post_date) = '$currentMonth' ORDER BY post_date desc"); } } for($currentMonth = 1; $currentMonth <= 12; $currentMonth++) $monthNames[$currentMonth] = ucfirst(strftime("%B", strtotime("$currentMonth"."$bogusDate"))); foreach($yearsWithPosts as $currentYear) { for ($currentMonth = 12; $currentMonth >= 1; $currentMonth--) { if ($monthsWithPosts[$currentYear->year][$currentMonth]) { echo get_archives_link(get_month_link($currentYear->year, $currentMonth), $monthNames[$currentMonth] . ' ' . $currentYear->year, '', '

', '

'); echo ''; } } } } /*edititing after this line is not only permitted but encouraged*/ ?>

Archives

Read the rest of this page »

'); ?>

By date:

By tags:

By category: