Chris asked: “how to make my comments WordPress 2.7 compatible?”

Chris Berry, one of my readers, asked on the forum how he can make his comment section compatible with WordPress 2.7. If like him, you’d like to know how, just read on!

Here's a basic comments loop for WordPress 2.7. You just have to replace your current comment loop with that one to make it work with WordPress 2.7.

<?php
if (have_comments()) : ?>
<h4 id="comments"><?php comments_number('No Comments', 'One Comment', '% Comments' );?></h4>
<ul class="commentlist">
	<?php wp_list_comments(); ?>
</ul>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<?php else : // this is displayed if there are no comments so far ?>
	<?php if ('open' == $post->comment_status) :
		// If comments are open, but there are no comments.
	else : // comments are closed
	endif;
endif;
?>

9 Responses

Nov 08 2008 13:18

Justin Tadlock also wrote a nice article about making your wordpress theme comments section compatible with both wordpress 2.6 and 2.7

http://justintadlock.com/archives/2008/11/01/making-your-themes-comments-compatible-with-wordpress-27-and-earlier-versions

Nov 08 2008 15:43

@cubus: great post from Justin! I have scheduled a recipe based on it for soon.

Nov 08 2008 16:37

That was fast. I will give this a try as soon as 2.7 is available.

Nov 09 2008 22:40

I won’t be downloading WP 2.7, not unless ALL of the plugs I’m using becomes compatible… which would be like a month after the 2.7 official release

Dec 25 2008 10:31

My theme was not supporting threaded comments. I have written a post on how to make comments compatible in Wordpress 2.7. Do check it http://www.niharsworld.com/2008/12/16/how-to-implement-threaded-comments-in-wordpress-themes/

Jul 29 2009 22:04

Sometimes it’s really that simple, isn’t it? I feel a little stupid for not thinking of this myself/earlier, though.

Oct 11 2009 03:40

It will be part of the prescient option under design now. ,

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required