The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Share:
Notifications
Clear all

Comment counter

3 Posts
2 Users
0 Reactions
1,155 Views
Posts: 2
Topic starter
(@antibo)
New Member
Joined: 4 years 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
2 Replies
Asti
Posts: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 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)
Joined: 4 years ago

New Member
Posts: 2

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

Reply
Share: