Last active
January 30, 2024 19:42
-
-
Save mjones129/6af721aaaf8f57b5d58da343aee05bba to your computer and use it in GitHub Desktop.
Exclude posts from WP_QUERY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$args = [ | |
'post_type' => 'any', | |
'post_status' => 'publish', | |
'order' => 'ASC', | |
'post__not_in' => [253, 236] | |
]; | |
$loop = new WP_Query( $args ); | |
if ( $loop->have_posts() ) : | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
the_content(); | |
endwhile; | |
endif; | |
wp_reset_postdata(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment