Home › Forums › Add-ons › Repeater Field › Need help wrapping a link around hero image banner › Reply To: Need help wrapping a link around hero image banner
In your foreach loop you would simply retrieve the value of the URL field inside the repeater and add an anchor element, as the documentation describes in the section titled “foreach loop”, like so:
foreach ($hero_banner_background_images as $i) {
$image = $i['hero_banner_background_image'];
$url = $i['hero_banner_url'];
…
Forget the $hero_banner_url = get_field('hero_banner_url');
you have there previously, outside the loop.
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.