Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Jan 22, 2021 4:36 pm
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 ?
2 Replies
Jan 23, 2021 9:11 am
Hi @antibo,
You can use the get_comments_number() function. More info here: https://developer.wordpress.org/reference/functions/get_comments_number/