I think you can use get_comments
.
In the type
parameter you can pass the type of comment (trackback, ping), you can filter by status, and you have a parameter called count
, that when is set to true
returns just the number of comments that match the parameters you passed.
get_comments(
array(
'status' => 'approve',
'post_id'=> get_the_ID(),
'type'=> 'pings',
'count' => true)
);
This example gets the number of approved pings for a post, you have to use it inside a loop, if not, the function get_the_ID()
wont work, but you just have to pass the ID as you want.
Related Posts:
- show number of open comments on custom dashboard
- Comment Count for each Comment Author
- How to auto-approve internal pingbacks?
- How can comments be submitted when I don’t have a comment box on a page?
- Altering the pingback functionality
- WordPress comment count to include attachment comments
- Pings and replies
- Separete trackbacks/pings and numbered comments
- Disqus comments and pingback script – how to change the order?
- Comments vs. Pingbacks next page issue
- Count comment threads, not total comments in a post
- Using defer or async JavaScript attributes prevents pingbacks and trackbacks from being sent
- How can I count only guests comments?
- Disable comments and pingbacks on old custom post types
- How many members have made comments approved for an article?
- How to Define Custom Number of Items in Comment Feed
- Comments and pingbacks issues
- It doesn’t matter if I have more than one comment. get_comments_number still equal to one?
- Default Gravatar not showing for pings
- How include comment and post count of user in this custom query
- R: Comment out block of code
- How to rearrange fields in comment_form()
- Commenting in user profile page?
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- How to load and show comments with AJAX instead of pagination?
- Comments not appearing at all
- Hook/Filter before and after comments
- Comment form validation
- Sticky Comments
- Comments number message in password protected post
- I have tried using Plugins to remove 72K comments with no success
- How to show Disqus comments and pingbacks?
- Display commenter’s registration date on comments?
- show un-approved comments at wordpress front end
- How to add consent checkbox in comment section
- How to add pagination to comments?
- WP 4.4.1 allow empty comments via add_action ‘pre_comment_on_post’
- How to get replies of a comment?
- Report spam button
- Share comment to twitter after publishing [closed]
- changing comment-page-# to something like review-page-#
- show if comment is in moderation
- Disable or Enable Comments on Front end [closed]
- Deleting the attached “comment replies” when trashing a comment
- How can I get a list of comments by target
- Load comments.php template outside the post loop
- Auto-fill Custom comment fields
- Highlighting the current users comment
- How to make all the posts commentable by default? Imputs in Settings/Discussions are not saved
- How to auto empty comment trash after X days
- comments.php keep comment date/time but remove date/time’s #hyperlink
- Control panel loads slowly due to 2 slow queries on comment table
- Display complete comment section via post ID
- Comment Pagination Behavior wp_list_comments() – comment ordering and pagination
- Check if comment was successfully submited
- After Submitting Comment Form Shows an Empy Page in WordPress
- Unique User for all visitor, but possibility to comment with unique name
- comments_array filter doesn’t work in some themes
- Redirect when click on “response” in comment section
- Link to a User’s Forum Profile From Their Comment
- Getting comment count per post not working
- if user role is then echo text
- strange behavior with comment position
- Safely editing core files
- Way to count the number of people who have commented on a post?
- Batch approve comments
- Add paragraph tags to comments
- How to tweak comment fields properly from functions.php
- How to allow duplicate comments?
- Two textareas showing up in comments.php
- Adding comments section to website integrated WordPress instance
- How can i change the order of comments?
- How indicate when a functions was upgraded in relationship to the entire program [closed]
- Empty comments field or
- infinite loop on page with comments after changing comments.php and header.php
- What templates/funtions needed in custom theme to allow comments the new 3.0 way
- How can I hide comment of the authors from their published posts?
- How to customize ‘children comments’ in WordPress?
- How do I refresh “Post Last Modified Time”, as long as comment is updated to Approve status?
- Disallow Comments
- Need to output comment_form() function inside a foreach loop
- Comment field override
- Keep comment author’s name on their comment even when their account is deleted
-   not working in comments
- Comments.php is not getting called on main blog page
- Allowing comments on author pages
- Comment section not appearing on posts
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- Where is the Leave a Comment link set
- Disable comment moderation in multisite
- URLs to user page is broken
- Comments Template shows, but not the comments
- Auto disable comments with custom field
- I want to fill the comment with the comment count?
- delete user not working
- Force logged in users to provide more data when commenting
- How to remove or customize “Comment” in comments form?
- Getting thousands of spam comments
- check if a comment was made by a registered user