wp-bootstrap-starteではカテゴリーページ等は記事が全て表示されてしまいますので「抜粋」で表示できる方法になります。

wp-bootstrap-starterは、カテゴリーページ等は記事が全て表示されてしまいますので注意が必要です。それでは抜粋で表示できる方法をご紹介します。

修正するページは「template-parts/content.php」になります。シングルページは全て記事を表示させ、その他のページは抜粋表示になります。

●修正前の「content.php 」↓

<div class="entry-content">
		<?php
        if ( is_single() ) :
			the_content();
        else :
        the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'wp-bootstrap-starter' ) );
endif;

●修正後の「content.php 」完成形 ↓

<div class="entry-content">
		<?php
        if ( is_single() ) :
			the_content();
        else :
//             the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'material-design-wp' ) );
$excerpt = get_the_excerpt();
echo $excerpt;
endif;

簡単な説明になります。下記の部分をコメントアウトします。

//  the_content( __( 'Continue reading →', 'material-design-wp' ) );

そして下記のコードを付け加えます。

$excerpt = get_the_excerpt();
echo $excerpt;
endif;