显示没有链接的评论数量

时间:2013-10-12 23:57:01

标签: wordpress

当我使用<?php comments_number('0', '1', '%'); ?>此代码时,带有范围HTML代码。我需要在a代码title属性上显示一些评论。那我该怎么办?

<div class="comment">
    <a href="#" title="<?php comments_number('0', '1', '%'); ?>"></a>
</div>

this is how is it looking

1 个答案:

答案 0 :(得分:0)

您可以使用get_comments_number()获取数值:

<div class="comment">
    <a href="#" title="<?php echo get_comments_number(); ?>"></a>
</div>
相关问题