I have created a wordpress query and I am trying to exclude one post with the id of 1293.
Here is the query I have written so far:
<?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(); ?>
post__not in
expects an array. Try the following:
$my_query = new WP_Query(array (
'post__not_in' => array(1293),
'post_type' => 'product',
'posts_per_page' => '100'
));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With