The same way you’d do it inside a normal loop.
Assuming you’re inside a loop of posts…
<?php comments_popup_link('No comments', '1 Comment;', '% Comments');?>
Would display, No comments, 1 comment, or X comments, where X is a number…
You could just have the number….
<?php comments_popup_link('0', '1;', '%');?>
Unless i’m having a blonde moment, i think it’s that easy…. 🙂
I’d like the number of comments to show up on an external page though. Ie. A site map page where each page link has its number of comments displayed next to it.
Why don’t you use a WordPress page/post for the sitemap?
Rather then having an external page and having to hook into WordPress.
Sorry – by external page, I meant external from the individual pages that I want comment counts from. So yes I want the ‘external page’ to be a wordpress post/page.
(@inazuma)
15 years ago
Hi,
I plan to create a web site for my game mod team, but I don’t want a forum. I plan to have a sub page structure, so eg.
-Projects
–For Age of Empires 3
—The Adventures of Captain Columbus project
—The Lord of the Rings mod
etc
I want people to comment on these pages rather than in a forum and so I figured a sitemap would be best suited to be used instead of the forum structure.
Now all I want to know is how do I get the number of comments to show up next to each page?
eg.
—The Lord of the Rings mod (24 comments)