Separating Trackbacks from Comments in WordPress 2.7+

Back when WordPress 2.7 was released, the WordPress team introduced a completely revamped comment form that included integration of threaded comments into the core software, introducing some dramatic changes with how comments are handled.   Unfortunately, this change broke one of the most popular comment hacks, separating trackbacks from comments.

Since then, several people have stepped up and shared some great hacks for separating trackbacks from comment in WordPress 2.7 or newer blogs .  So far the best guide I’ve found came from Sivel.net, which can be viewed here.  Click over and follow those steps get everything separated.

Note: The above guide is only for people using WordPress 2.7 or newer installations.  For people using WordPress 2.6 or earlier, you’ll want to use this tutorial.

Once you’ve got the comments successfully separated from the trackbacks, there are a couple additional tweaks you may want to do to clean up how things look (it really depends on preference I suppose).   The first is to clean up your trackbacks/pingbacks by only displaying the title instead of an excerpt and everything else.   In order to do this, you’ll need to find the following code in your comments.php file:

<ol>
<?php wp_list_comments('type=pings'); ?>

Now replace that code with the following:

<ol>
<?php wp_list_comments('type=pings&callback=list_pings'); ?>

Lastly, you’ll need to add the following code to your functions.php file (which can be created if you don’t already have one):

<?php
function list_pings($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?>
<?php } ?>

That should clean up the trackbacks/pingbacks section and you can also apply the same changes if you use a plugin to display tweetbacks.

The other thing you may want to do is fix the comment count to only show actual comments, filtering out the trackbacks/pingbacks which are included in your comment count by default.   Simply add the following code to your functions.php file (which again can be created if you don’t already have one):

<?php
add_filter('get_comments_number', 'comment_count', 0);
function comment_count( $count ) {
if ( ! is_admin() ) {
global $id;
$comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
return count($comments_by_type['comment']);
} else {
return $count;
}
}
?>

So there you go.  Anyone have any other tips for cleaning up your comment form?

Tweet This | Digg This | Stumble it |

WordPress 2.7.1 Now Available

I know this post is a little late and most of you have probably already noticed this in your WordPress dashboard already, but WordPress 2.7.1 is now available to download.  This update includes at least 68 bug fixes, so it is definitely worth making the upgrade.

As this is the first update in the WordPress 2.7.1 branch, I just wanted to make sure everyone knows that you can now easily upgrade from within your dashboard by going to Tools –> Upgrade.  Those of you waiting to upgrade to the WordPress 2.7.x branch until the first update was available will still need to upgrade manually.

Tweet This | Digg This | Stumble it |

Still No WordPress 2.7.1

Okay, so the title is a little misleading, but I wasn’t really sure how to title this post.    What I wanted to do was write a quick post to congratulate the WordPress team on the great success that has been WordPress 2.7 launch!

In case you haven’t noticed, we are coming up on 2 full months now since the release of WordPress 2.7  and there hasn’t been a WordPress 2.7.1 release yet, which shows that everything was well tested prior to the official launch.  

For those of you that have been with WordPress for a few years or so, I imagine you’ll appreciate this accomplishment the most.   I remember getting to the 2.x.7 or higher releases with most WordPress branches and I think at least once we got to double digits before the next major release?  

Out of curiosity, for those of you that traditionally like to wait until the first security patch is released to upgrade to the next major branch, have you already upgraded or are you still waiting to experience WordPress 2.7?

Tweet This | Digg This | Stumble it |

Warning: WordPress 2.7 Comment Pagination Creates Duplicate Content

One of the lesser talked about features introduced in WordPress 2.7 is the new feature that breaks comments into multiple pages to create faster load times.   By default, this feature is activated and set to allow 50 comments before the break.    The problem is, with this new feature activated, your WordPress blog is creating duplicate content.

Here is what I found while checking my Google Webmaster Tools account for this website:

Duplicate Title Tags

wphacks-title-tags

Duplicate Descriptions

wphacks-descriptions

Is this a huge deal?  Probably not, but you may want to consider unchecking this box in your Dashboard > Settings > Discussion tab.   Hopefully in a future version of WordPress this will NOT be checked by default and instead be an option.

break-comments

Tweet This | Digg This | Stumble it |

Someone Please Rescue the Popularity Contest WordPress Plugin

Possibly my favorite WordPress plugin of all time has always been the Popularity Contest WordPress plugin from Alex King.    Back when WordPress 2.5 first came out, there was a minor scare where Popularity Contest quit working on new WordPress blogs, but a fix was eventually published and once again all was right with the world.

Now that WordPress 2.7 has been released, I noticed the other day while setting up a couple new niche blogs that Popularity Contest appears to again be broken on fresh installations of WordPress 2.7.    My WordPress installations which already had Popularity Contest installed and were upgraded to WordPress 2.7 seem to still be working fine.

While checking for updates on the authors page, I noticed that it appears that Popularity Contest (along with Alex’s other plugins) are no longer supported and will not receive any future updates.  In fact, the last update was over a year ago.   The only exception I know of is the Share This plugin, which I believe was purchased by someone who has continued to improve the plugin.

My hope with this post is that someone will either take over supporting this WordPress plugin (if Alex is willing to hand it over to someone), or that someone will create a similar plugin for the WordPress community.   Heck, something like this that is supported and gets regular feature updates might even be something I would happily pay a one time fee for!

Anyone having luck with Popularity Contest and brand new WordPress 2.7 installations?

Tweet This | Digg This | Stumble it |