我遇到了一個問題,這是很煩人的。 問題是我在頁腳中有兩個循環,它們加載了來自兩個不同類別的最後3個帖子。它看起來像:WordPress的 - 帖子中顯示的帖子有相同的the_excerpt()輸出
<?php $posts = get_posts('category=21&orderby=desc&numberposts=3'); foreach($posts as $post) { ?>
<div class="footer-text-block">
<a href="<?php the_permalink() ?>" target="_parent">
<span class="footer-white-bold"><?php the_title(); ?></span>
</a><br />
<span class="footer-grey-thick"><?php the_excerpt(); ?></span>
</div>
<?php } ?>
<?php $posts = get_posts('category=22&orderby=desc&numberposts=3');
foreach($posts as $post) { ?>
<div class="footer-text-block">
<a href="<?php the_permalink() ?>" target="_parent">
<span class="footer-white-bold"><?php the_title(); ?></span>
</a><br />
<span class="footer-grey-thick"><?php the_excerpt(); ?></span>
</div>
<?php } ?>
以及它的輸出是: http://i.stack.imgur.com/5C58t.png
而這在其上顯示的頁腳我的帖子的內容: http://i.stack.imgur.com/R6ok7.png
你有什麼想法爲什麼會發生這些傢伙?
謝謝!這解決了我的問題! – 2014-10-03 12:32:58
我的榮幸。請享用 :-) – 2014-10-03 12:33:40