Yearly archives
UncategorizedSeptember 2007
<h3>Yearly Archives</h3>
<ul>
<?php
$years = $wpdb->get_col(“SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status = ‘publish’ 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>