On http://wordpress.barrycarter.info/index.php/page/7/ I disabled comments for "USDCAD options vs CADUSD options arbitrage?", but it still has a "Leave a Comment" link.

Clicking the link takes you to http://wordpress.barrycarter.info/index.php/2011/02/25/usdcad-options-vs-cadusd-options-arbitrage-2/#respond where it, of course, shows that you can't leave a comment.

The timeline page correctly does not show the 'comment' link: http://wordpress.barrycarter.info/index.php/2011/02/

How to fix?

link|improve this question

47% accept rate
What Theme are you using? – Chip Bennett Apr 27 '11 at 16:50
Ahh, I see: TwentyTen. Just a minute; fix coming up. – Chip Bennett Apr 27 '11 at 16:51
feedback

2 Answers

up vote 3 down vote accepted

In the loop.php template file, you will find this line:

<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>

If you don't want "leave a comment" to display if comments are closed, you can wrap the call to comments_popup_link() in a if ( comments_open() ) conditional, like such:

<span class="comments-link"><?php if ( comments_open() ) comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>

Note: you may also want to check the other loop-foobar.php template files.

link|improve this answer
This did the trick, once I realized that line appears in loop.php 3 times! – barrycarter Apr 27 '11 at 17:09
1  
Might be a good idea to use a child theme to avoid losing changes in future versions. – John P Bloch Apr 27 '11 at 18:41
Always a good reminder, John. I generally assume that a Child Theme will be the method of implementation, but that might not always be a valid assumption. :) – Chip Bennett Apr 27 '11 at 20:01
feedback

We removed the links to comments using a simple Javascript.. Website Design Bradford Check our websites out.

link|improve this answer
feedback

protected by Community Jul 31 '11 at 8:52

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.