Home › Forums › General Issues › Filtering WP_Query results by select field › Reply To: Filtering WP_Query results by select field
in your above code where you have
// the loop
while ($loop->have_posts()) : $loop->the_post();
wrap the while loop in an if
// the loop
if ($loop->have_posts()) :
while ($loop->have_posts()) : $loop->the_post();
// the rest of while loop
endif;
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.