the_excerpt – WordPress*リファレンス
終わりに…がある現在のポストの抜粋を表示します。(それは、”read more”リンクではありません)。 あなたが明白な抜粋をポスト(ポストエディタの任意の抜粋分野の)に供給しないなら、ポストの内容の最初の55の単語が使用されています。 後者の場合ではも、抜粋の内容からHTMLタグとグラフィックスを剥取ります。 Loopの中にこのタグはあるに違いありません。
⇒Displays the excerpt of the current post with [...] at the end, which is not a “read more” link. If you do not provide an explicit excerpt to a post (in the post editor’s optional excerpt field), the first 55 words of the post’s content are used. Also in the latter case, HTML tags and graphics are stripped from the excerpt’s content. This tag must be within The Loop.
the_excerptのテンプレートタグ使用方法
<?php the_excerpt(); ?>
例
デフォルトの使い方
ポスト抜粋を表示します。 非単一の、または、非permalinkのポストでは、抜粋がthe_content()にLoopの中にやむを得ず示す交換品として使用されています。
⇒Displays the post excerpt. Used on non-single/non-permalink posts as a replacement for the_content() to force excerpts to show within the Loop.
<?php the_excerpt(); ?>
Use with Conditional Tags
アーカイブ(is_archive()によってテストされる)かカテゴリ(is_category())ページで取り替えるとき、the_content()タグを
the_excerpt()に取り替えます。
より多くのバージョン1.5のための仕事の下における両方の例。
⇒Replaces the_content() tag with the_excerpt() when on archive (tested by is_archive()) or category (is_category()) pages.
⇒Both the examples below work for versions 1.5 and above.
<?php if(is_category() || is_archive()) {
the_excerpt();
} else {
the_content();
} ?>
1.5の前のWordPressのバージョンのために、以下だけが働くでしょう:
⇒For versions of WordPress prior to 1.5, only the following will work :
<?php if($cat || $m) {
the_excerpt();
} else {
the_content();
} ?>
the_excerptのパラメーター
このタグには、パラメーターが全くありません。
⇒This tag has no parameters.
関連テンプレートタグ
the_ID,the_title,the_title_attribute,single_post_title,the_title_rss,the_content,
the_content_rss,the_excerpt,the_excerpt_rss,previous_post_link,
next_post_link,posts_nav_link,the_meta
関連記事







