Thank you for responding.
I contacted support with a ticket originally and they said it wasnt possible….
So I concocted this crap.
Now I see that they are wrong and it is possible.
My issue was one of my layouts had a relationship field.
I wanted to get the relationship ID’s.
So I used
This does get the ID’s only but breaks the_row and stops the rest of sections outputting.
I got the Id’s a different way (got the whole object and then used $object->ID)
As for the file exists voodoo:
get_template_part doesnt keep variables so if you make something like this:
$var = 5; get_template_part()....
You cant use $var inside that template.
So it’s kinda stupid.
This allows you to get a template part without losing your variables, or needing to use global.
It also uses locate_template which gets the right template if there is a child theme.
Works nicely 🙂
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!
© 2022 Advanced Custom Fields.