rendered paste body <div id="content"> <? /* ---- HERE TEH POSTS BEGINS ---- */ ?> <div class="post"> <?php if (have_posts()) : ?> <!--<p><small>Latest Articles</small></p>--> <?php global $wpdb; ?> <?php $results = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS year, MONTH(post_date) AS month, count(ID) as posts FROM $wpdb->posts WHERE post_date != '0000-00-00 00:00:00' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC"); $months_array = array ( '1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December' ); ?> <div class="entrytext"> <?php foreach ( (array) $results as $month ) { query_posts("year=$month->year&monthnum=$month->month"); echo '<strong><a href="/'.$month->year.'/'.$month->month.'/">'.$months_array[$month->month].' '.$month->year.'</a></strong>'; echo '<ul class="postspermonth">'; while (have_posts()) : the_post(); echo '<li>'.get_the_time('j').': <a href="'.get_permalink().'">'.get_the_title().'</a></li>'; endwhile; echo '</ul>'; } ?> </div> </div>