如何在Wordpress中循环外显示和创建最新帖子的方框?我在此链接http://i.imgur.com/UbBvlnE.png的图片上显示了这一点。我在红框中谈论这个;) 抱歉我的英文。
我在主页http://sickdesigner.com/masonry-css-getting-awesome-with-css3/
上的所有帖子都使用了Masonry CSS这是循环的代码:
<div class="all_center">
<?php query_posts($query_string."&orderby=post_date"); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_post_thumbnail('mediumImageCropped'); ?>
<div class="entry">
<?php the_excerpt(); ?>
<div class="postmetadata">
</div>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<h2>Not Found</h2>
<?php endif; ?>
</div>
答案 0 :(得分:0)
$recent_posts = wp_get_recent_posts( array( 'numberposts' => '1' ) );
echo get_the_post_thumbnail($recent_posts[0]['ID'], 'thumbnail');
echo $recent_posts[0]['post_content'];