Tag Info

New answers tagged


Use my way <?php $commentscount = get_comments_number(); if($commentscount == 1): $commenttext = 'comment'; endif; if($commentscount > 1 || $commentscount == 0): $commenttext = 'comments'; endif; echo $commentscount.' '.$commenttext; ?> its working in all version.


You're re-inventing the wheel here ;-) The Problem You're bypassing WordPress with this approach, so that's explains the error message. Accessing any custom file, within your theme directory, will not load WordPress core automatically. Already available This is already supported by the WordPress core. You should check out comments_popup_link() and ...


You are missing 2 parameters in your function report_spam. Also the priority should not be 1. Try the code below. add_action('transition_comment_status', 'report_spam', 10, 3); function report_spam($new_status, $old_status, $comment){ if($new_status == 'spam'){ var_dump($comment->comment_author_IP); die; } } I've set die so ...

Top 50 recent answers are included