the_excerptで同じ内容になる。
-
こんばんは。
どなたかお力をお貸し下さい。the_excerptを使用して最新の投稿5件を表示する様にしています。
しかし、なぜか一番最新の記事の抽出分が五件全てに反映されてしまいます。<?php $posts = get_posts('numberposts=5'); ?> <?php setup_postdata($post); ?> <?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> <div class="clear"></div> </div> </div><!-- index_contents --> <div class="dotline"></div> <!-- #post-## --> <?php endforeach; ?> <!--index_contents-wnewend-->
上記が埋め込みのコードとなりますが、何か不自然な点等ありますでしょうか?
どれだけ考えても出てこないので、お力をお借りしたいと思います。大変申し訳ございませんがよろしくお願いします。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「the_excerptで同じ内容になる。」には新たに返信することはできません。