diff --git a/archives.php b/archives.php index b312f6c..c508dbc 100644 --- a/archives.php +++ b/archives.php @@ -29,4 +29,72 @@ get_header(); ?> - \ No newline at end of file +posts "; + $sql .= "WHERE DATE_FORMAT(post_date, '%Y') <> '0000'"; + $sql .= " AND post_status = 'publish'"; + $sql .= " AND post_type = 'post' "; + $sql .= "GROUP BY DATE_FORMAT(post_date, '%Y'), DATE_FORMAT(post_date, '%m') "; + $sql .= "ORDER BY DATE_FORMAT(post_date, '%Y') DESC, DATE_FORMAT(post_date, '%m') ASC;"; + + $months = $wpdb->get_results($sql); + + if (!empty($months)) + { + foreach ($months as $month) + { + // Add in the year heading + if (($year == "") || ($year != $month->Year)) + { + if (strlen($output)) + { + $output .= "
\n" . $month->Year . ": "; + } + else + { + $output .= "\n" . $month->Year . ": "; + } + } + + // Add in the monthly archive links + if ($year == $month->Year) + $output .= $month_separator; + + $output .= '' . date($month_format, mktime(0, 0, 0, $month->Month, 1, $month->Year)) . ''; + + $year = $month->Year; + } + } + else + { + $output = "

None available

\n"; + } + + print $output; +} + +?> \ No newline at end of file diff --git a/functions.php b/functions.php index d7a1e4d..465aee8 100644 --- a/functions.php +++ b/functions.php @@ -12,11 +12,6 @@ function melville_theme_styles(){ } add_action( 'wp_enqueue_scripts', 'melville_theme_styles' ); -//include 'plugins/drop-caps/wp_drop_caps.php'; -if (!function_exists('arl_kottke_archives')) { - include 'plugins/arl_kottke_archives.php'; -} - /** * Set the content width based on the theme's design and stylesheet. *