Home › Forums › General Issues › Show message if link field is empty › Reply To: Show message if link field is empty
function notna_slika_link() {
$link = get_field('prikaz_notne_slike');
if ($link) {
$link_url = $link['url'];
$link_title = $link['title'];
$link_target = $link['target'] ? $link['target'] : '_self';
return
'<div class="pdf-btn-out">
<div class="pdf-btn">
<div class="pdf-inner">
<a href="' . $link['url'] .'" target="' . $link['target'] .'">' . $link['title'] .'</a>
</div>
</div>
</div>'
;
} else {
/// return what you want if no link is entered
}
}
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.