Ping/Track/Comment Count
About
This plugin, co-created by Chris J. Davis, Scott Merrill, and Mark Jaquith in one magical rainbow-filled night contains two functions that return and echo the number of pingbacks, trackbacks, combined pings or regular comments for a WordPress entry.
This is of particular use to people who want to separate their regular comments from their pings. The plugin is “smart” and will grab all the numbers in one go the first time you call it, so that subsequent calls use no database queries, making it very efficient.
Download
Usage
There are two functions you can use: get_comment_type_count() (which returns the value) and comment_type_count() (which echoes the value).
Both functions operate identically, and take 2 optional parameters. The first parameter is the type of comment you would like returned (defaults to ‘all’). Your options are trackback, pingback, ping, and comment.
For example, pretend that a post has 1 pingback, 2 trackbacks, and 4 regular comments.
<?php
comment_type_count('pingback'); // prints "1"
comment_type_count('trackback'); // prints "2"
comment_type_count('ping'); // prints "3" (1 pingback + 2 trackbacks)
comment_type_count('comment'); // prints "4"
comment_type_count(); // prints "7" (1 pingback + 2 trackbacks + 4 comments)
?>
The second parameter, which is also optional, is a post ID. By default, the function just gives you the number for the current post being processed in “the loop.” By passing a specific post ID, you can get the count for any post ID you wish.
<?php
comment_type_count('pingback', 534); // prints number of pingbacks on entry 534
?>


Source Code couldn’t be displayed.
Micha, just moved to a new server. Thanks for pointing that out. I’ll try and get that fixed.
Alright, it should be fixed now!
It is fixed.
When I added the code to my post.php file, it limited my index to one post per page. Is there a way to solve this? This seems to be the only working plugin to so all of this, right now.
Did you get an error? The only reason I can think that it would limit it to one post is if there was an error and it stopped outputting the page after that. Let me know what the error was and I’ll look into it.
No, unfortunately, there was no error outputted
You sure? You viewed the source of the page and looked at the place where the function is called and there was no error?
No error at all. There’s not even a whitespace in the source where the function is being called.
Hi, does this mean that I can count the number of trackbacks, and comments on another blog?
John
Hi, sorry I understand your plugin is for the an individual blog, my real question is this, how would I count comments or trackbacks on another blog without having to do it manually?
You can’t. You’d need access to their database.
Hi, I am having problem with this great plugin. When I activate it in my WP2.0 plugin page, the following message shown above my admin page header after the plugin page is reloaded:
And it makes one of my plugin, the LiveCalendar not working. Everything back to normal when “Ping/Track/Comment Count” is disabled. May I know if there is anything I can modify in my blog to solve the conflict? (Except disabling LiveCalendar)
Thank you.
You must have an extra space after the closing
?>in the plugin … make sure there is no space after that.Yeah~! It’s fixed, thanks~!!
Thanks Mark, makes sense.
just wondering where to put this code. as i can’t find the post.php file
Within the WordPress loop would be the best location.
Thanks, that’s exactly what I was looking for! In fact there’s quite a lot of stuff you’ve got here that I’d like to ‘borrow’; could you please point me towards the plugin/tag/whatever for the Blog Author/Subscribed buttons you’re using? Thanks again.
Seems that it doesn’t work with Wordpress 2.0.3. I get an error about already send headers everytime I try to save a document and the default WYSIWYG Editor is gone.
I always get the following error message after activating this plugin:
Warning: Cannot modify header information - headers already sent by (output started at wp-content/plugins/count_trackbacks.php:64) in wp-includes/pluggable-functions.php on line 272
Does somebody know it? Or better does somebody know how to fix it?
Nice…
This is free sites. Thank you!
food allergy food intolerance
Hi,
[quote]When I added the code to my post.php file, it limited my index to one post per page. Is there a way to solve this? This seems to be the only working plugin to so all of this, right now.[/quote]
I am getting the same thing!
No errors of any kind either.
Also, for your example how can I make it output:
1 pingback
2 trackbacks
3 pings
4 comments
Take Care,
Will
mini motorcyclevintage motorcyclemotorcycle seatmotorcycle salvage yardmotorcycle trike
Hi My Name Is ivatut.
Your site is perfect!
Nice! I’ll definately check back here!
I can do a blog on your website? how much it will cost?
aspen big pizza sausage
aspen big pizza sausage
I have visited your site 116-times
I could not find this site in the Search Engines index
I thought that the WTO would be a good start for transforming the process of government at least across national borders. I quite like the idea of using the secretariat of the WTO as the centre for a Wikipedia of trade - a sort of open source world government at least for a very specific and complicated issue which needs many brains to provide a solution.
infiniti of denver
fiberglass entry door
chris de burgh
interstitial cystitis
machine margarita
wal mart portrait studio
adt alarm
express scripts.com
sportsmans warehouse
florist detroit
cole slaw recipe
insulated lunch bag
portable rental service toilet
broker paisley ticket
<a href%
buy sell.com
chinchilla cages
abu garcia
bondage hose pantie
ais insurance
Hello, very nice site, keep up good job!
Admin good, very good.
hi, thanks for the code, very handy to help me separate my pings and comments.
battle star galactica http://catalogss.phpnet.us/map1.html
a
a
doolar car rental
doolar car rental
elora gorge
michell kwan
mario frangoulis
volusia county property appraiser
hassock
College degree will be an advantage.
# Have a minimal experience and knowledge of basic bank operations.
# The ability to operate with more than one task effectively,
and have an adaptable, flexible, professional attitude
# The ability of stable communication with
our company and on-time and detailed reporting.
blog interview job
hsbc job offshore putrajaya vacancy
http://volny.cz/jjob - job online training
job opportunity physician
free interview job tip
http://volny.cz/jjob/map.html - center job mississippi win
http://groups.msn.co