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?
Have you even tried the code?
I’m sorry, I’m doing my best to help you but you’re not really helping yourself here.
Your topic title doesn’t match your question
Your initial question is a bit vague and mentioned hiding the heading – which I did
Your initial code is not complete
The code I’ve provided hides the title based on a user role – you restrict it by amending which roles are in the array
It also hides specific files based on the user role
You’ve not really provided any other details, so trying to provide a solution without all the information.
Unlike a WP Query, you can’t query a repeater as such. Therefore, you need to loop through the repeater, if it meets your requirements i.e. visible to specific roles, then show the files.
For people to assist you, you need to assist them! Provide a clearer question, provide your code and outline exactly what you wish to achieve.
Based on the information provided, the supplied code does what you’ve asked – hides the heading and files based on a user role.
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.