Home › Forums › ACF PRO › Custom gallery image link › Reply To: Custom gallery image link
Each image has an image ID, you use this ID to get the custom fields.
Example:
foreach ($images as $image) {
$value = get_field('your custom field name', $image['ID']);
);
or something like:
foreach ($images as $image) {
?>
<a href="<?php the_field('your link field name here', $image['ID']; ?>">something here</a>
<?php
);
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.