1
我创建了一个WordPress的查询和我试图排除一个职位与1293排除帖子ID
这里的ID是迄今为止我已经写查询:
<?php
$my_query = new WP_Query(array (
'post__not_in' => array(1293),
'post_type' => 'product',
'posts_per_page' => '100'
));
?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
不,这仍然不起作用,产品仍然显示 –
您确定该ID是正确的吗? – markusthoemmes
是的,它绝对正确,我会编辑顶部向您展示我正在使用的完整代码 –