Or, how I conquered WordPress trackback links in K2. Here's how I got the trackbacks to show up in the sidebar. When I was rebuilding the site, I'd got the wild idea that I wanted to emulate two folks, John Gruber and the Daring Fireball: Linked List, and the trackbacks and shape of the page of Kottke.org. When I saw k2 for the first time, that's what I thought, that it would be rather simple to put those two elements in. As I worked on the site, it because apparent that smarter people than I put plug-ins together. In a relative sense, the Linkness section came up rather quickly. The fact there was an archive was just an added bonus. However, as much work as I put into controlling my site's look, I couldn't figure out, in my head, how to make the trackbacks thing work. At first, I'd thought to use the IPAT (Inline Pingbacks and Trackbacks) plugin. But, since there was some voodoo going on in the comments template, I figured I'd better stay far away from it: it would most definitely catch the site on fire. Lost in how to do this in K2, I went to the K2 forum, and asked them. I got some really neat, innovative answers. None of them worked, or at least in a way I could figure out or use. But one thing steveo said was:

hmm. the post id appears to be: $wp_query->query_vars['p'] with that you can copy & paste the pingback/trackback stuff in sidebar.php (this is untested - cross your fingers):

Then he put in some really neat code that didn't work. But it was that 'p' that got me thinking. If it's passing that thing around, how's about messing with it in the sidebar? So, against my better judgement, I did something silly, that obviously wouldn't work: I stuck the IPAT code in the sidebar.php file. It worked. I'd never thought about how IPAT's main purpose was to drag the trackbacks out of the comments section and into the main post (always fun for open trackback festivals, get them TTLB stats up!). Putting it in the sidebar was, oddly enough, as simple as sticking it in the sidebar. In fact, three lines of code, and you're just like me:   <?php if (is_single()) {; ?>      <div class="inline_trackbacks"><?php ipat('<strong>Other site discussions:</strong><br />', 50, '<br />'); ?></div>   <?php } ?>The is_single in there because it'll show up on every page if you don't, including the front page. This got the stuff showing up in the sidebar, but it was also in the comments. What to do? Go into comments.php, and comment out everything in-between: if (k2_comment_type_detection() != "Comment") { ?> to <?php } } /* end for each comment */ ?>. And pray. And hope. Some wishing. Wishing always helps.

status: published
lastmod: '2006-10-02T17:56:01.000Z'
author: John Stansbury
cms: wordpress
custom:
  podPressPostSpecific: 'a:6:{s:15:"itunes:subtitle";s:15:"##PostExcerpt##";s:14:"itunes:summary";s:15:"##PostExcerpt##";s:15:"itunes:keywords";s:17:"##WordPressCats##";s:13:"itunes:author";s:10:"##Global##";s:15:"itunes:explicit";s:7:"Default";s:12:"itunes:block";s:7:"Default";}'
  _utw_tags_0: 'a:5:{i:0;O:8:"stdClass":1:{s:3:"tag";s:6:"design";}i:1;O:8:"stdClass":1:{s:3:"tag";s:2:"k2";}i:2;O:8:"stdClass":1:{s:3:"tag";s:6:"plugin";}i:3;O:8:"stdClass":1:{s:3:"tag";s:6:"update";}i:4;O:8:"stdClass":1:{s:3:"tag";s:9:"wordpress";}}'
  similarterms: nbsp sidebar trackbacks site comment comments work ipat quot worked thought page code trackback thing single post main fact inline
comments:
  - id: '8'
    author: MacStansbury.org &raquo; Blog Archive &raquo; Hello world!
    date: '2006-04-13T02:56:33.000Z'
    content: '[...] In other news, like I said before, this isn&#8217;t the only Hello world! [...]'
  - id: '9'
    author: MacStansbury.org
    date: '2006-04-13T03:17:05.000Z'
    content: |-
      <strong>Hello world (again)!...</strong>

      Gotta love playing around with my own site. Continuing the evil....