How do I get the trackback count of a post in wordpress without writing an SQL query?
You can specify what kind of comment you want to retrieve using get_comments(). // Assumes you’ve set $post_id somewhere. $args = array( ‘type’ => ‘trackback’, ‘post_id’ => $post_id, ); $trackbacks = get_comments( $args ); $trackback_count = count( $trackbacks ); Edited to add: As Sally CJ points out in the comments, you can do this in … Read more