Title: the_excerptの記述について
Last modified: 2013年5月27日

---

# the_excerptの記述について

 *  解決済 [seabow](https://ja.wordpress.org/support/users/seabow/)
 * (@seabow)
 * [13年、 5ヶ月前](https://ja.wordpress.org/support/topic/the_excerpt%e3%81%ae%e8%a8%98%e8%bf%b0%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/)
 * 初めまして。
    いろいろな記述を参考に 色々挑戦してみたのですが、どーやっても 自力
   で解決できずにここで相談させて頂きたいと思います。
 * 記事抜粋で使用するthe_excerptですが、
    index.php内に記述させたところなぜか 表示
   がされず困っております。
 * どなたかご教授下さいますでしょうか？
    〜現在記述〜
 *     ```
       <h2>更新情報</h2> </div>
   
       <?php $posts = get_posts('numberposts=5'); ?>
       <?php foreach($posts as $post): ?>
   
       <div id="archiveindex" class="odd link">
       <div class="archiveindex_entry">
       <div class="archiveindex_entry_left">
       <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(120,100), array('class' => 'left')); ?></a></div>
   
       <div class="archiveindex_entry_right">
   
       <h4 class="mainindex_entrytitle"><a href="<?php the_permalink(); ?>">
       <?php the_title(); ?></a></h4>
       <div class="archiveindex_entry_text"><a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a>
       </div>
       </div>
       ```
   
 * 下から３段目のthe_excerptの記述を施しているのですが、
    表示されません。
 * もちろんWP MultibytePatchの有効化はしておりますし
    configファイルのリネームも
   した上で症状改善が 見られません。
 * お分かりになられる方、いらっしゃいましたら
    何卒お願い致します。

2件の返信を表示中 - 1 - 2件目 (全2件中)

 *  [tecking](https://ja.wordpress.org/support/users/tecking/)
 * (@tecking)
 * [13年、 5ヶ月前](https://ja.wordpress.org/support/topic/the_excerpt%e3%81%ae%e8%a8%98%e8%bf%b0%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-161561)
 * seabowさん
 *     ```
       foreach($posts as $post):
       ```
   
 * の後に
 *     ```
       setup_postdata($post);
       ```
   
 * がないからではないでしょうか？　ちなみに、確認になりますが
 *     ```
       <?php foreach($posts as $post): ?>
       ```
   
 * の対になる
 *     ```
       <?php endforeach; ?>
       ```
   
 * は、示されたコードの後に書かれているんですよね？（そもそもなければエラーになり
   ますし）
 * [テンプレートタグ/get posts – WordPress Codex 日本語版](http://wpdocs.sourceforge.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/get_posts)
 *  トピック投稿者 [seabow](https://ja.wordpress.org/support/users/seabow/)
 * (@seabow)
 * [13年、 5ヶ月前](https://ja.wordpress.org/support/topic/the_excerpt%e3%81%ae%e8%a8%98%e8%bf%b0%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-161562)
 * >tecking様
 * ご教授ありがとう御座います。
    tecking様のおっしゃって頂いたsetup_postdataの 記述
   で一発解決致しました。
 * ありがとう御座います！
 * ちなみにもちろんですが、
    `<?php endforeach; ?>` は記述してございます。
 * 本当に勉強になりました！
    ありがとう御座います！

2件の返信を表示中 - 1 - 2件目 (全2件中)

 トピック「the_excerptの記述について」には新たに返信することはできません。

## タグ

 * [記事抜粋](https://ja.wordpress.org/support/topic-tag/%e8%a8%98%e4%ba%8b%e6%8a%9c%e7%b2%8b/)
 * [the_excerpt()](https://ja.wordpress.org/support/topic-tag/the_excerpt/)

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2件の返信
 * 2人の参加者
 * 最後の返信者: [seabow](https://ja.wordpress.org/support/users/seabow/)
 * 最後の活動: [13年、 5ヶ月前](https://ja.wordpress.org/support/topic/the_excerpt%e3%81%ae%e8%a8%98%e8%bf%b0%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-161562)
 * 状態: 解決済

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
