Wordpress评论循环
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Wordpress评论循环相关的知识,希望对你有一定的参考价值。
Just the basic Wordpress comments loop.
<!-- recent comment of each post --> <div class="recent-comment"> <?php $count = 1; ?> <?php if ($comment_array) { ?> <span class="comment"> <?php comments_number('No comment','1 comment','% comments'); ?></span> - Latest by: <ul class="commentlist"> <?php foreach($comment_array as $comment){ ?> <?php if ($count++ <= 2) { ?> <li><?php comment_author_link(); ?> <br /> <?php comment_excerpt(); ?> </li> <?php } ?> <?php } ?> </ul> <?php } else { ?> <!-- if there was no comment in that post,yet --> <span class="comment">No comment so far</span> <?php } ?> </div> <!-- end recent comment-->
以上是关于Wordpress评论循环的主要内容,如果未能解决你的问题,请参考以下文章