Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

this isn't major but would be nice. Would like to have 2 titles for the comment form, one that says "no comments yet start the discussion" and another that says "join the discussion". I've had a good look around but I can't see anything already posted about doing this. Can anyone assist? Skip.

(I may use different phrases but you get the general idea I'm sure).

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Use get_comments_number() to get … well … the number of comments. In your theme’s comments.php you can use its return value to do something:

$num = (int) get_comments_number();

if ( 0 === $num )
    echo 'Be the first! But please don’t write just “First!”';
elseif ( 100 < $num )
    echo 'Yeah, add some noise. Nobody will read it.';
else
    echo 'Please write a comment';
share|improve this answer
    
Thank you that makes perfect sense to me. Will accept the answer and Toscho I recall you've helped me a few times so thank you very much. –  Paul Brown Nov 6 '13 at 11:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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