記事の抜粋分を表示します。抜粋の長さはデフォルトで110文字(日本語)です。
the_excerpt();なし。
記事の抜粋分を表示(echo)します。また表示する際に自動的にpタグで文章を囲みます。pタグを除去したい場合やそもそも表示ではなく取得したい場合はget_the_excerpt()を利用します。
<div class="article">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="article__date"><?php echo get_the_date() ?></div>
<div class="article__heading"><?php the_title() ?></div>
<div class="article__content"><?php the_excerpt(); ?></div>
<?php endwhile; ?>
<?php endif; ?>
</div>※当サイトでは初期値とデフォルト値の言葉の定義を区別せず、原則統一して初期値を採用しています。