评论关闭时 Wordpress 不显示摘录

Wordpress doesn't show excerpt when comments are off

我的 wordpress 主题有问题。它有效,但是当我想关闭评论时,它没有显示摘录。

第一张图是允许评论时的样子,第二张图是不允许评论时的样子。

Comments allowed

Comments off

这是来自 content.php 页面的代码片段:

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<div class="entry-header-title">


    <?php if ( is_single() ) : ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php else : ?>
    <h1 class="entry-title">
        <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
    </h1>
    <?php endif; // is_single() ?>

    <span class="entry-meta-date">
        <?php twentythirteen_entry_date(); ?>
    <span>|</span>


    <?php if ( comments_open() && ! is_single() ) : ?>
        <span class="entry-comments" >
                    <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a Reply', 'twentythirteen' ) . '</span>', __( '1 Comment', 'twentythirteen' ), __( '% Comments', 'twentythirteen' ) ); ?>
        </span><!-- .entry-comments -->

    </span><!-- .entry-meta -->

    <?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
        <div class="entry-thumbnail">
            <?php the_post_thumbnail(); ?>
        </div>
    <?php endif; ?>


</div>


</header><!-- .entry-header -->

<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
    <?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
    <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-links"><div class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</div>', 'after' => '</div>', 'link_before' => '<div>', 'link_after' => '</div>' ) ); ?>
</div><!-- .entry-content -->

<?php endif; ?>

<footer class="entry-meta">



        <?php endif; // comments_open() ?>

        <div class="entry-labels">
        <?php twentythirteen_entry_meta(); ?>
        </div>

        <div class="entry-share">
            <?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>
        </div>




        <div class=".post-spacer">
        </div>

</footer><!-- .entry-meta -->
</article><!-- #post -->

<div class="linkwithin_div"></div>

您不小心删除了一个<?php endif;?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<div class="entry-header-title">


<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
    <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; // is_single() ?>

<span class="entry-meta-date">
    <?php twentythirteen_entry_date(); ?>
<span>|</span>


<?php if ( comments_open() && ! is_single() ) : ?>
    <span class="entry-comments" >
                <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a Reply', 'twentythirteen' ) . '</span>', __( '1 Comment', 'twentythirteen' ), __( '% Comments', 'twentythirteen' ) ); ?>
    </span><!-- .entry-comments -->

</span><!-- .entry-meta -->
//THIS ONE
<?php endif; // comments_open() ?>


<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
    <div class="entry-thumbnail">
        <?php the_post_thumbnail(); ?>
    </div>
<?php endif; ?>


</div>


</header><!-- .entry-header -->

<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links"><div class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</div>',   'after' => '</div>', 'link_before' => '<div>', 'link_after' => '</div>' ) ); ?>
</div><!-- .entry-content -->

<?php endif; ?>

<footer class="entry-meta">




    <div class="entry-labels">
    <?php twentythirteen_entry_meta(); ?>
    </div>

    <div class="entry-share">
        <?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>
    </div>




    <div class=".post-spacer">
    </div>