Archived Pages

<ul><li><h2>Archives</h2>

<ul>

<?php

$years = $wpdb->get_col(“SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_type = ‘post’ ORDER BY post_date DESC”);

foreach($years as $year) :

?>

<li><a href=”<?php echo get_year_link($year); ?> “><?php echo $year; ?></a></li>

<?php endforeach; ?>

</ul>

</li></ul>