Exclude, pass over if ACF checkbox is checked (or 1)
-
For some reason I can’t offset posts that have WP’s native sticky option checked using Custom Content Shortcode. So, no big deal. I created a checkbox in ACF with a similar purpose and now I can have them offset.
[loop field=stick_post value=1]
Problem is I have another loop that displays posts from the same category and I want to exclude all posts where
stick_post
has been checked.Instead of excluding and skipping over these sticky posts entirely, it’s just printing out 2 columns worth of content instead of 3.
[raw] [loop type=post category=features count=3 orderby=rand] [if field=stick_post value=1][else] <div class="col-md-4"> [field image image_class="img-square" size="thumbnail"] </div> [/if] [/loop] [/raw]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Exclude, pass over if ACF checkbox is checked (or 1)’ is closed to new replies.