0
我有兩塊代碼都試圖從不同的類別分別拉出單個帖子,但他們都返回相同的帖子 - 第二個的內容是確切的。這裏是我的代碼...wordpress - 類別的多個get_option返回相同的結果
<!-- homepage block 1 - START -->
<? $homepage = get_option('of_homepage') ?>
<?php query_posts('category_name='.$homepage.'&posts_per_page=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Add your content here -->
<div id="m2" class="f-ms">
<div id="m3" class="f-ms">
<h3 class="subtitlessmaller f-fp f-lp">
<?php the_title(); ?>
</h3>
</div>
<div id="m4" class="f-ms">
<p class="whitewider f-fp">
<?php the_content(); ?>
</p>
</div>
</div>
<?php endwhile;?>
<!-- homepage block 1 - END -->
<!-- homepage block 2 - START -->
<? $homepage2 = get_option('of_homepage2') ?>
<?php query_posts('category_name='.$homepage2.'&posts_per_page=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Add your content here -->
<div id="featboxtitle" class="f-ms">
<p class="f-fp f-lp"><span class="subindex"><?php the_title(); ?></span></p>
</div>
<div id="featimage" class="f-ms">
<p class="f-fp f-lp"><?php the_post_thumbnail(''); ?></p>
</div>
<p class="smaller">
<?php the_content(); ?>
</p>
<?php endwhile;?>
<!-- homepage block 2 - END -->
我完全新的WordPress的所以請原諒我,如果我所試圖做的是不可能的
我想自己上是這樣的,祝賀對我自己今天是一個很好的幫助:-) – user2317093