wordpress调用最新文章

wordpress调用最新文章

<?php $recentPosts = new WP_Query();

$recentPosts->query(‘showposts=7’);

?>

<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>

<li> <span style=”display:none”>[<?php the_time(‘m/d’) ?>]</span>

<a href=”<?php the_permalink() ?>” rel=”bookmark” target=”_blank”><?php the_title(); ?></a>

</li>

<?php endwhile; ?>

Drop Your Comment