Merge pull request #132 from davidensinger/master

Load comments template only when comments are open or there's at least one comment in image.php and page.php
This commit is contained in:
sixhours 2013-02-28 08:45:06 -08:00
commit 4134038278
2 changed files with 10 additions and 2 deletions

View File

@ -109,7 +109,11 @@ get_header();
</footer><!-- .entry-meta --> </footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> --> </article><!-- #post-<?php the_ID(); ?> -->
<?php comments_template(); ?> <?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template( '', true );
?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>

View File

@ -20,7 +20,11 @@ get_header(); ?>
<?php get_template_part( 'content', 'page' ); ?> <?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?> <?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template( '', true );
?>
<?php endwhile; // end of the loop. ?> <?php endwhile; // end of the loop. ?>