Home › Forums › General Issues › Anchor links referring to itself › Reply To: Anchor links referring to itself
Well, either set the field “web_address” to “required” or check for existence of the field first before creating the paragraph with the link.
<?php if (get_field('web_address')) { ?>
// your code
<?php } ?>
And I don’t think the link is to the page URL when not filled out in the backend, it’s probably just empty. Try this:
echo get_field('web_address')
And you should get nothing for an empty field.
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.