Home › Forums › General Issues › Exclude posts › Reply To: Exclude posts
Old post I know but it popped to the top due to spammers.
If anyone is looking or this you can add a filter that will run on just a specific query by adding the filter before your query and then removing it after.
add_filter('pre_get_posts', 'my_pre_get_posts'); // do your query remove_filter('pre_get_posts', 'my_pre_get_posts');
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.