K2 Quickie: Show Text for Trackbacks

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.

Like it? Tweet it.

"K2 Quickie: Show Text for Trackbacks" by @Stammy

Get new articles via email