2010-08-24 64 views

回答

1

Virendar,

使用get_posts()应该解决您的问题如下...

<ul> 
<?php 
$myposts = get_posts('orderby=date&order=DESC'); 
$tempdate = ''; 
foreach($myposts as $post) { 
    $postDate = strtotime($post->post_date); 
    if ($tempdate == '' || $postDate < $tempdate) { 
    $tempdate = $postDate; 
    echo '<h3>Display Date Title here</h3>'; 
    } 
?> 
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> 
<?php } ?> 
</ul> 

希望这有助于!请注意我没有包含任何CSS格式。