Monday, May 21, 2007

WordPress - separating Trackbacks and Pings from normal comments

I have not been getting Trackbacks and Pings mixed in with my comments for some time now and thought it might be nice to sort that out once and for all in my theme. A starting point was provided by cre8d-design.com, but was not looking exactly as ordered as I wanted it to be. I prefer the Trackbacks and Pings to be summaries and the actual comments to be complete. Here is the results (see my Linux courses page for example of resulting Comments, Trackbacks and Pings):

# edit your themes comments.php file and
# look for the starting points I have provided.
#
<!-- You can start editing here. -->

</code><h3 id="trackbacks">Trackbacks/Pings</h3>
<ul class="commentlist">



<li class="">smaller">
id="comment-">
<p><cite> 
by  —  @ <a href="http://www.blogger.com/post-edit.g?
blogID=3868547292717970492&postID=5015798110612907785#
comment-%3C?php%20comment_ID%28%29%20%20%20%20
%20%20%20%20%20%20%20%20?%3E"></a></cite></p>

comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>



</li>
</ul>

<h3 id="comments">Comments</h3>
<ol class="commentlist">


<li class="">" id="comment-">
<cite></cite>

comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>

<p class="commentmetadata">
<a href="http://www.blogger.com/post- edit.g?
blogID=3868547292717970492amp;postID=5015798110612907785#
comment-%3C?php%20comment_ID%28%29%20%20%
20%20%20%20%20%20%20%20%20%20%20%20%20?%3E" title=""> at </a> </p>
</li>
</ol>


I hope this helps you to sort out something for your own site with regards to Comments, Trackbacks and Pings. ;-)