K2 Quickie: Show Text for Trackbacks

June 20, 2006 · 10 comments

One minor annoyance people have with the K2 WordPress theme is that trackbacks and pingbacks are shown only as links with no supporting text from the trackback site. When it comes to having articles with many trackbacks, it is highly advantageous to be able to quickly spot out what each site is saying about your articles without having to visit each one. Fortunately you can easily add this feature with a simple WordPress tag.

Login to your server and navigate to the K2 folder within the wp-content/themes directory. Open up comments.php in your favorite text editor and search for the following piece of code between line 77 and 85.

K2 Quickie

You will want to add one of the following two WordPress tags between </small> and </li>: <?php comment_excerpt(); ?> or <?php comment_text(); ?>. The comment excerpt tag will, as expected, only show a small excerpt of the trackback text while the comment text tag shows the entire trackback text. You will most likely want to use <?php comment_text(); ?>. Place the tag you choose to use between the closing small and li tags and then save the file.

K2 Quickie
This is what the completed comments.php should look like. Only one WP tag was added.

Head over to your site and find a popular post with tons of trackbacks. You will be delighted to see that a short description from each trackback is included under the trackback link.

{ 5 trackbacks }

kobak’s bookmarks » Blog Archive » links for 2006-06-21
June 21, 2006 at 3:30 pm
Bright Meadow » Sunday Roast: I shaved my beard for you, devil woman!
June 25, 2006 at 6:03 am
How to spice up your comments area: Part 2 » nektros - Cynicism in a Hot Dish
May 29, 2007 at 6:18 am
K2 w Wordpress i pokazywanie treści trackback/pingback at /home/Śpiechu->Blog
February 10, 2008 at 5:58 pm
Amoxicillin alternative.
April 5, 2008 at 7:42 am

{ 5 comments… read them below or add one }

1 Cory June 20, 2006 at 8:35 pm

awesome thanks

Reply   More from author

2 Dennis June 20, 2006 at 9:19 pm

Excellent tip there Paul……you have done it again! Thanks.

Reply   More from author

3 Derek Punsalan June 21, 2006 at 12:23 am

I was always surprised that K2 didnt’ offer the option to show snippets out of the box for users. Personally, I prefer to keep things nice and clean opting instead for trackback titles (and nothing else). Nonetheless, your writeups are superb and easy to understand as always.

Reply   More from author

4 kobak June 21, 2006 at 4:52 am

Thanks! I’m using it now.

Reply   More from author

5 Michael Benson June 22, 2006 at 8:46 am

Excellent addition. :) I’ve applied this modification to my K2 template, i was often wondering how to improve the display of trackbacks and pingbacks in K2, i guess this is the solution.

Reply   More from author

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: Opera 9 Released

Next post: Launchy, QuickSilver for Windows