Home › Forums › General Issues › Page Link field content in a function › Reply To: Page Link field content in a function
Sorry, I thought this was for the link field and not the page link field.
The page link field doesn’t return link text and only returns the URL and you’d need to supply the text some other way.
$link = get_field('your_link_field_name');
if ($link) {
echo '<a href="'.$link.'"><span>Button text</span></a>';
}
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.