wordpress4.1.1首页显示摘要

修改 /wp-content/themes/主题名/content.php

<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );

wp_link_pages( array(
'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'after'       => '</div>',
'link_before' => '<span>',
'link_after'  => '</span>',
) );
?>
</div><!-- .entry-content -->

改为

<div class="entry-content">
<?php
/* translators: %s: Name of current post */
if(!is_single()):
the_excerpt();
else:
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
endif;
wp_link_pages( array(
'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'after'       => '</div>',
'link_before' => '<span>',
'link_after'  => '</span>',
) );
?>
</div><!-- .entry-content -->

发表评论

电子邮件地址不会被公开。 必填项已用*标注