wpDiscuz - WordPress Comment Plugin
Share:
Notifications
Clear all

Comment counter


antibo
Posts: 2
Topic starter
(@antibo)
New Member
Joined: 1 month ago

Hi, 

is there a way to get the number of comments for a post or CPT ?

Something like an API method getPostCommentsCount($post_id) => return (int) 125 ?

Topic Tags
api
2 Replies
Asti
Posts: 2144
 Asti
Support
(@asti)
Support member
Joined: 3 years ago

Hi @antibo,

You can use the get_comments_number() function. More info here: https://developer.wordpress.org/reference/functions/get_comments_number/

Reply
1 Reply
antibo
(@antibo)
Joined: 1 month ago

New Member
Posts: 2

@asti Of course ! I’m so dumb !! Sorry for that :/

Reply
Share: