Skip to content

Instantly share code, notes, and snippets.

@aliciaduffy
Last active August 29, 2015 14:15
Show Gist options
  • Save aliciaduffy/32191674fa96400fe995 to your computer and use it in GitHub Desktop.
Save aliciaduffy/32191674fa96400fe995 to your computer and use it in GitHub Desktop.
Comment count check
<a name="respond"><span style="display: none;">Respond</span></a>
<div id="peta_comments">
<?php
// Get comment count
$comment_count = wp_count_comments( get_the_ID() );
// If there are comments, display note and comments
if ( $comment_count->approved > 0 ) { ?>
<h6>Commenting is closed.</h6>
<div class="clear"></div>
<!--Comment List-->
<ul class="list_comments">
<?php wp_list_comments( $list_comment_args ); ?>
</ul>
<div class="pagination">
<?php paginate_comments_links( array('prev_text' => '« Prev', 'next_text' => 'Next »', 'type' => 'list')); ?>
</div>
<?php } ?>
</div>
<!--End Comment List-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment