1
在WordPress循环某些职位,我怎么能阻止我的帖子出现的2,即排除:我怎样才能排除从WordPress循环
<?php while (have_posts()) : the_post(); ?>
这可能吗?
谢谢!
在WordPress循环某些职位,我怎么能阻止我的帖子出现的2,即排除:我怎样才能排除从WordPress循环
<?php while (have_posts()) : the_post(); ?>
这可能吗?
谢谢!
试试这个:
query_posts(array('post__not_in' => array(1,2)));
if (have_posts()) : while (have_posts()) : the_post();
其中1和2是要排除的职位。
使用继续吗? – Achrome
是的,这是可能的。你想在哪里应用这个? –
一个简单的方法是制作一个垃圾类别,并将其排除在外。 http://wordpress.org/support/topic/exclude-posts-from-wp_query –