IF with PASS and checking for empty field
-
Hi,
I’m trying for hours to figure this out without success… I have a CPT named faculty and inside I have an ACF field named faculty_linkedin.
In a specific page of my site, and for simplicity sake, I have three independent dropdown select boxes for my client to choose from the list of faculty (program_faculty1, program_faculty2 and program_faculty3). These select boxes store the post ID.
I am able to retrieve each ACF faculty_linkedin using PASS
[pass field=program_faculty1] [content type=faculty id={FIELD} field=faculty_linkedin] [/pass]
But now I need to check if the ACF field faculty_linkedin is empty or not and echo more information accordingly.
[pass field=program_faculty1] [if id={FIELD} type=faculty field=faculty_linkedin] THE FIELD IS NOT EMPTY [content type=faculty id={FIELD} field=faculty_linkedin] [else] THE FIELD IS EMPTY [/if] [/pass]
This is always giving me “THE FIELD IS EMPTY”, even when the field has input.
I also tried adding empty=true and empty=false inside the IF statement, but nothing changed.
Can someone point me into the right direction here?
Many thanks in advance!
- The topic ‘IF with PASS and checking for empty field’ is closed to new replies.