Don't show comments on passworded posts

This commit is contained in:
Ben Word
2013-02-06 15:45:41 -06:00
parent 714982fa42
commit 8128bfda4c

View File

@@ -1,3 +1,9 @@
<?php
if (post_password_required()) {
return;
}
?>
<?php function roots_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?>>
@@ -25,15 +31,6 @@
</article>
<?php } ?>
<?php if (post_password_required()) : ?>
<section id="comments">
<div class="alert alert-block fade in">
<a class="close" data-dismiss="alert">&times;</a>
<p><?php _e('This post is password protected. Enter the password to view comments.', 'roots'); ?></p>
</div>
</section><!-- /#comments -->
<?php endif; ?>
<?php if (have_comments()) : ?>
<section id="comments">
<h3><?php printf(_n('One Response to &ldquo;%2$s&rdquo;', '%1$s Responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'roots'), number_format_i18n(get_comments_number()), get_the_title()); ?></h3>