$previous_year = $year = 0;
$previous_month = $month = 0;
$ul_open = false;
$myposts = get_posts('numberposts=-1&orderby=post_date&order=DESC');
foreach($myposts as $post) :
setup_postdata($post);
$year = mysql2date('Y', $post->post_date);
$month = mysql2date('n', $post->post_date);
$day = mysql2date('j', $post->post_date);
if($year != $previous_year || $month != $previous_month) :
if($ul_open == true) :
echo '';
endif;
echo '
'; echo the_time('F Y'); echo '
';echo '
$ul_open = true;
endif;
$previous_year = $year; $previous_month = $month;
?>
<?php the_time('j'); ?>日 <?php the_title(); ?> <?php comments_number('0', '1', '%'); ?>人评论 <?php if(function_exists('the_views')) the_views(); ?>次浏览