Hope it helps!
]]>$query = new WP_Query( array( ‘post_type’ => ‘post’, ‘post__not_in’ => array( 160, 163, 165 ) ) );
// OR This WILL work
$exclude_ids = array( 160, 163, 165 );
$query = new WP_Query( array( ‘post__not_in’ => $exclude_ids ) );
However, if you use a variable for the custom query you’ll have to use it for every call inside the loop (e.g. $query->have_posts()
instead of have_posts()
). A workaround is to use query_posts()
instead of $query = new WP_Query();