最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
wordpress中首页文章下显示评论内容
时间:2013-06-03 编辑:简简单单 来源:一聚教程网
首页文章下面显示若干条的评论内容,包括作者头像、评论时间、评论内容等,没有直接回复的功能,具体代码如下:
代码如下 | 复制代码 |
$args = array( 'status' => 'approved', 'number' => '5', 'post_id' => get_the_ID() ); $comments = get_comments($args); foreach($comments as $comment) : echo( get_avatar($comment->comment_author_email,64) . $comment->comment_author . ' ' . $comment->comment_content ); endforeach; |
代码放在首页循环里就可以了。
相关文章
- WordPress不显示博主自己的评论 05-05
- WordPress文章显示评论内容而不是标题 09-07
- WordPress 评论添加楼层显示两种方法 06-03
- HTML简单购物数量小程序代码展示 10-31
- html canvas实现弹幕功能 10-31
- HTML中空格表示的意义 10-31