Loop if an ACF flexible field is not empty
-
Hi,
I want to make a loop display only the posts which have any ACF flexible value.
Currently, I am using this code:
[pass global=route] [loop type=case taxonomy=arbitrator term='{FIELD_2}']<br> [if field="damages"] <div class="case-content case-dama"> [field title-link] <h2>DAMAGES</h2> [flex damages] [layout fet-text] <p class="single_acf_text">[field fet-text]</p> [/layout] [layout fet-select] <p class="single_acf_select">[field fet-select]</p> [/layout] [/flex] </div> [/if] [/loop] [/pass]
This code displays all the posts which have any value in
damages
ACF Flexible Content field, such as:POST_1 DAMAGES Flexible Content POST_2 DAMAGES Flexible Content POST_3 DAMAGES Flexible Content
What I need is:
DAMAGES POST_1 Flexible Content POST_2 Flexible Content POST_3 Flexible Content
Is there any method to proceed with a loop only if a certain field exists?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Loop if an ACF flexible field is not empty’ is closed to new replies.