How to Implement the RA Project Comment Section
Reader DJ Slim asks:
I absolutely love the layout of your comments section, with the pictures off to the side. I have never seen anything quite like it.
Would you be willing to share your code along with the css stuff so i could implement it on my blog?
Well Slim, I will absolutely share the code as nothing on this site is propriety. The code may be messy, but it’ll get you what you want.
Let’s start with the end result first:
The Final Solution
The reader wants the desired look of the person being shown to the left with the comment on the right. Furthermore, I have also separated trackbacks from comments.
The Necessary Files
You will need to modify two files to get this effect and also install one plugin.
You Need the Gravatars2 Plugin
The plugin that we use here at RA Project is called Gravatars2. You can use your own Gravatar plugin if you like, but you’ll have to modify some code.
You Need a Modified Comments.php
What I have attached at the end of this post is a modified comments.php. Within this file is a change to the comments loop and numerous helper functions. You could separate out these helper functions, but for the sake of simplicity I included them all in one place.
You Need the Styles
Also attached at the end of this post is the styles necessary to have the desired look. It should all work out of the box if you copy the contents of the “comments.css” file into your theme stylesheet.
Download the Files
The downloadable ZIP contains both the modified “comments.php” and “comments.css” file. You need to place the “comments.php” file in your theme directory and also copy the contents of “comments.css” to your default stylesheet.
Please download the RAP Comment Section.
Customization
Changing of the colors and such can be done using the stylesheet. The things you’ll want to change is the background and text colors. I apologize for the messiness of the code.
Questions/Support
Please leave a comment if you need help. I’m rather busy these days, but I’ll try to answer questions as soon as I can.
Thank you Slim for asking the question.






cerebralmum says...
This is great. Thank you for sharing. I’m going to have a look at incorporating some of this into my page. I’ve been wanting, especially, to separate my trackbacks for a while. In fact, I’ve been deleting the “comments” from my internal links because they just mess up the dialogue. I’d really like to have three separate parts - comments first, then external trackbacks, then a list of linked internal.
Or I think that’s what I’d like. I haven’t yet figured out the best way to handle internal trackbacks. I like the related posts function (which I need to recode for since upgrading to WordPress 2.3) on the bottom of the post before the comments section but I wonder… Is having the internal links listed as well too much for readers, or is it helpful for readers wanting to explore?
Ronald Huereca says...
cerebralmum,
I haven’t investigated too much in separating internal links and trackbacks. I usually just include those with my other trackbacks.
You bring up a good point. Are internal links valuable at all? Isn’t that what related posts are for? I’ll have to ponder this some more.
rzrarti says...
That’s a great thing! Thanks for it!