【发布时间】:2015-01-04 09:40:46
【问题描述】:
我有代码:
<div id="content88">
<div class="tip">
<div style="margin-left: 9%; margin-top: -2px;">
<center><h1><font style="margin-left:-50px;" font-size="20px" color="#BCBDC1">Last 5 posts from category</font></h1></center></p>
<?php
$catquery = new WP_Query( 'cat=11446&posts_per_page=5' );
while($catquery->have_posts()) : $catquery->the_post();
?>
<h4><a href="<?php the_permalink() ?>" rel="bookmark"><font color="#fff"><?php the_title(); ?></font></a> - <b>Last update:</b> <span class="entry-date"><?php echo the_modified_time('Y/m/d \a\t g:i A'); ?></span> </h4> </p>
<?php endwhile; ?>
<center><h4><a href="#"><font style="margin-left:-50px;" font-size="14px" color="#BCBDC1">Click here for more results</font></a></h4></center></p>
</div>
</div>
</div>
此代码列出了特定类别的最后 5 个帖子。看起来是这样的:
它还提供发布特定帖子的时间,如上图所示。我想要做的是在帖子旁边有 x 小时/天前的图像,它看起来像这样:
但是即使从我应该开始的地方我也没有想到正确的方法,我也找不到任何接近我需要的东西,也许有人可以从我应该开始的地方给我一个例子?谢谢。
【问题讨论】: