12 Jun
Currently one of the limitations of using the otherwise great comments service Disqus is that it doesn’t allow you to display trackbacks/pingbacks. Apparently this will be fixed in a future release of the Disqus WordPress plugin, but for now it’s not working.
The trackbacks you receive are still stored locally in your database, despite them not being displayed, so you can access them. However there isn’t a built-in way to access just the list of trackbacks. Trackbacks are stored as comments in the wp_comments table and are identified by a comment_type of either ‘trackback‘ or ‘pingback‘. (For our purposes here, there’s no real difference between the two. For more info on what the actual difference is, see this page) So, if you wanted to you could write up a bit of PHP that pulled all the trackbacks out of the database & displayed them on your blog, but for a lot of people this is a bit much.
If you look on this page (the FriendFeed Comments Plugin page), you can see a list of the trackbacks that page has received. It’s a very simple list, I’m not displaying the text snippet that usually comes with trackbacks, but that’s just personal preference. If you’d like to be able to display your trackbacks without having to worry about writing code yourself I’ve got a really simple plugin that lets you do this here. The plugin adds 2 functions, get_approved_trackbacks & trackbacks_template. get_approved_trackbacks takes the post id as an argument and returns a list of the trackbacks that have been approved (moderated) for that post. trackbacks_template is essentially an additional template tag to be used in the same way as comments_template() is used on the single.php template file.
So for example, if you wanted to display the trackbacks before the comments, download & install the plugin. Then open up the single.php template file for your site & find the line <?php comments_template(); ?>. Stick <?php trackbacks_template(); ?> on the line above it. This will display the trackbacks as an unordered list inside a div with the id "trackbackslist" with a h3 heading "Trackbacks" above the list. However if you’d like to style it differently, it will also look for a template file called trackbacks.php in your template folder. If it finds that it will use that to render the trackbacks. This is what I’m doing here so as to not display the trackback text. By default the plugin will display that too.
Obviously this is an advanced option, and only for those familiar with HTML & PHP. For those people, the plugin provides a variable called $trackbacks which is an array of comment objects. The code that I’ve used to display the trackbacks by default is contained in a file called ‘trackbacks.php’ in the plugin folder, which you can copy into your template folder to use as a starting point for styling your own list.
Hopefully Disqus will sort out what it’s going to do with trackbacks, according to Daniel from Disqus it’s coming soon. I’m pretty happy with their service, they’ve been really responsive to any support requests and they’ve had pretty solid uptime. The lack of trackbacks isn’t really a big deal to me, but I do like to show who’s discussing my posts. As usual please leave comments / bug reports on the plugin’s page.
22 Responses for "Showing trackbacks with Disqus"
Did you know of the Jangro Disqus Hack before you wrote this plugin? Just wondering. This is the hack I’m using on my site.
I had seen that, and it works great. I’m just always hesitant to edit
plugins that I don’t control, especially with the Wordpress Auto Updater.
Inevitably It’d overwrite my changes & I wouldn’t notice for a week or
something like that. I did that recently with another plugin that I had to
modifly slightly because it was conflicting with another.
I just found myself writing the code for this into my single.php template &
I thought “this is silly, what if I change templates?” so I wrote it as a
plugin, and so I figured if it was useful to me, someone else might want to
use it to
I hear ya. In fact, I made extensive changes to a particular plugin and then auto-upgraded it without thinking a week later, so yes, you have a very valid point!
I’m half-tempted to switch to your solution, but at this point I have a silly superstition that if I hold out with what I have, it will somehow bring the much-anticipated disqus update sooner.
If only it worked that way
[...] Showing trackbacks with Disqus – Development on a Shoestring Good stopgap for displaying trackbacks using the Wordpress Disqus plugin. (tags: disqus wordpress trackbacks) [...]
Great Post mate and I must say DIsqus rocks.. I been using it on my blog for months
Any infromation on Disqus for Joomla?
Thanks for the sharing info .
Disqus rocks !
I really like disquss, so flexible and easy to use
I really like disquss, it easy to use and we can follow our friends too
Disqus is great, we can follow our friend comment with disqus
thanks for the post
The diqus plugin is great. I see it as a new tools that'll help me. I think it will help others too
Thnx for the info i hope it works on my blog.
I'm curious about this too.. Would be nice if a bridge was made…
Yeah, I'm curious too.. Would be nice if a bridge was made..
Disqus, in my opinion is the future of commenting. It simplifies that work of the webmaster and makes everything much much simpler.
great article.visited your site for first time today,but i must say your write is of top notch and i will surely frequent your site.
This is very informative post, I loved reading it, thanks for posting this, yeah I always say Disqus rocks!!
Whtas so special about track Backs?
i agree disqus is a great comment systen
Troye Silvan – For Them” post under the username que? (with the x being the lowercase greek letter chi). I did so just to test something (and ended up testing this question I have now). Now that I've joined Disqus (my Disqus username being quex), the comment I posted under que? earlier today has been changed to quex (the ? is now an x). Obviously not a big deal here, but if I hrsaccount posted under a completely different name at another blog (same email address though), would they all change to “quex
Leave a reply