Home › Forums › Add-ons › Repeater Field › Acf while loop if any rows return this value once? › Reply To: Acf while loop if any rows return this value once?
You asked:
I would like to hide the headline outside the loop
I assumed $download_headline was therefore outputting the headline.
As such, the code solution I gave did exactly that!
Given the code provided, this gets the user role of the logged in person – this much I believe would be required to ensure your initial code works.
You can therefore wrap your file inside the loop with the same conditional:
if( array_intersect($author_roles, $user->roles ) ) :
//YOUR FILE
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.