开发者

WordPress - How do I display the total number of comments from an entry?

开发者 https://www.devze.com 2023-01-08 01:02 出处:网络
I am displaying WordPress content on a static HTML page, which is outside of the WordPress content. It is working very nicely and I just need one more element to complete the set.

I am displaying WordPress content on a static HTML page, which is outside of the WordPress content. It is working very nicely and I just need one more element to complete the set.

I am using this code:

<?php while (have_posts()): the_post(); ?>
  <h5><?php the_title(); ?></h5>
  <p class="blog-info"><?php the_time('m'); ?>.<?php the_time('j'); ?>.<?php the_time('y'); ?> | <a class="comment-ref">13 Comments</a></p>
<?php endwhile; ?>

The last part I need is the part where you can see a link with the total number of comments associated with the entry. Something like this:

<a class="comment-ref">13 Comments</a>

I am no开发者_开发问答t very familiar with WordPress so I could use some help getting that last bit of code.

Thanks!


You need something like this...

<a class="comments-ref" href="<?php comments_link(); ?>">
  <?php comments_number('0', '1', '%'); ?> Comments
</a>


Here is an article that may be of interest to you. :)

e: Nice job, JAG2007.

0

精彩评论

暂无评论...
验证码 换一张
取 消