Home › Forums › General Issues › How to add an anchor link with Advanced Custom Fields › Reply To: How to add an anchor link with Advanced Custom Fields
I’d look at your code for where you’re spitting out the ACF field value for the div ID. In your non-working example, it’s just showing it standalone vs. as the ID so, your example in the source is:
<div id="" style="display: none;">
#baddog
<div class="flavors">
<div class="flavorsleft">
<picture>
<source type="image/webp" srcset="https://headley.tfm-dev.com/wp-content/uploads/2023/01/baddog-1.png.webp"/>
<img src="https://headley.tfm-dev.com/wp-content/uploads/2023/01/baddog-1.png" alt=""/>
</picture>
</div>
And where #baddog is, that should be spit out in the ID field instead. If you post the code for your template itself, may be easier to identify the error but that’s definitely what is causing it to not work. It should be:
<div id="baddog" style="display: none;">
<div class="flavors">
<div class="flavorsleft">
<picture>
<source type="image/webp" srcset="https://headley.tfm-dev.com/wp-content/uploads/2023/01/baddog-1.png.webp"/>
<img src="https://headley.tfm-dev.com/wp-content/uploads/2023/01/baddog-1.png" alt=""/>
</picture>
</div>
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.