Support » Plugins » Hacks » If no comments

  • ald0413



    My client would like it if I could only show the number of comments if there are actually comments.

    I have tried the function reference from this page,, but it doesn’t work, and it references twentyten, so I fear the information is out of date.

    Would someone be able to point me in the right direction?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p


    what theme are you using?



    I”m using a custom theme that I have created starting from BlankSlate

    Moderator t-p


    Try doing something like this in your theme’s comments.php:

    <?php if ( have_comments() ) : ?>
    		<h2 class="comments-title">
    				printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentythirteen' ),
    					number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘If no comments’ is closed to new replies.