我使用query_posts作爲「Page」項目而不是「Post」。我希望能夠將「精選」頁面始終放在最前面,我們可以添加一個名爲「featured_product」的自定義字段,如果它是「1」,則將該帖子顯示爲第一個。wordpress query_posts精選頁面總是在頂部
下面是查詢的基本代碼。有人請幫忙!?
<?php query_posts(array('showposts' => 1000, 'post_parent' => $post->ID, 'post_type' => 'page', 'orderby' => 'title', 'order' => 'ASC')); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
...
<?php endwhile; else: ?>
...
<?php endif; ?>
這是在http://wordpress.stackexchange.com/上提出的一個很好的問題。 – 2010-11-11 21:22:22