How to Display Track backs after Comments in Wordpress Thesis Theme?

by Pascal on December 30, 2009

In normal, Trackbacks are shown before the comments appear in thesis theme. Some bloggers block trackbacks from showing them in their blogs. But displaying track backs is a good practice. Because whenever some people see you having more trackbacks, they also want to link back to the article as it worth for their readers.

Can I show Trackbacks after comments?

One of my reader Jaydip asked a below question here.

Thanks for wonderful article. I am still having one request for you. Can we change order of Trackback and Comments.

I mean to say in default thesis you will first find Trackbacks and then Comments. but I would like to have First Comments and then Trackback.

Yes. You can. But not recommended. Because if you have more comments in a particular post, trackbacks will go to very bottom. Readers hardly read there.

But for some reason you might be thinking to do that. So here is the simple tutorial for that. By this simple code move, you can show comments before track backs in your thesis theme.

  1. Go to your wordpress admin dashboard.
  2. Click on ‘Editor’ under ‘Appearances’ tab.
  3. You can see the below code in comments.php
global $thesis;?><div id="comments"><?php

 
if (have_comments()) { // If there is available feedback of any kind.
foreach ($comments as $comment) {
if ($comment->comment_type == 'trackback' || $comment->comment_type == 'pingback')
$linkbacks[] = $comment;
else
$only_comments[] = $comment;
}
if ($linkbacks) {
thesis_comments_intro(count($linkbacks), pings_open(), 'trackbacks');
?>
<dl id="trackback_list">
<?php
foreach ($linkbacks as $comment) {
?>
<dt><?php echo apply_filters('thesis_trackback_link', get_comment_author_link(), $comment); ?></dt>
<dd><?php echo apply_filters('thesis_trackback_datetime', '<span>' . sprintf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()), $comment) . '</span>'; ?></dd>
<?php
}
?>
</dl>
<?php
}

 
// Display comments (how deep does this rabbit hole go?).
if ($only_comments) {
thesis_comments_intro(count($only_comments), comments_open());
?>
<?php thesis_comments_navigation(); ?>
<dl id="comment_list">
<?php
thesis_list_comments();
?>
</dl>
<?php thesis_comments_navigation(2); ?>
<?php }
elseif (comments_open())
thesis_comments_intro(0, comments_open()); }

 

4. Just swap the codes in red and green.
Remember before swapping code, copy and paste the code in comments.php as back up.

So that if you broke something, you can get back yours.

That’s all. Now you can see change, comments first and trackbacks next.

Related Tutorials:

  1. How to Create Custom Social Bookmark Links Widget in Thesis Theme
  2. Thesis Theme 1.7 – Upgrade to Use Amazing Features
  3. Wordpress Guide for Handling Settings Tab
  4. How to highlight Author comments with image and background color in Thesis theme?

{ 6 comments… read them below or add one }

Jaydip Parikh January 2, 2010 at 10:27 AM

Hey Pascal,

One more good article. Keep sharing this kind of wonderful information with us.

Reply

Pascal January 2, 2010 at 11:03 AM

welcome jaydip,
keep on watch our site. we have more thesis tutorial.
Thanks for your words.

Reply

Harsh Agrawal January 3, 2010 at 7:56 AM

Hey Pascal this is pretty useful as lots of trackback might create an exit point for readers

Reply

Pascal January 3, 2010 at 9:33 AM

Yoru are right harsh. thats why i changed trakback below comments. thanks for your kind words

Reply

Alison Moore Smith February 24, 2010 at 5:58 AM

I’ve tried this repeatedly and every time I get a a parse error on line 44. Any ideas?

Reply

Pascal February 24, 2010 at 7:47 AM

At the time of interchanging the code. you have to copy and paste the code very carefully. if you are miss any character you got error. i will contact you via e-mail.

Reply

{ 1 trackback }

TheWebBlend.com
December 31, 2009 at 7:34 AM

Leave a Comment

Page 1 of 11