Home › Forums › Front-end Issues › Displaying Fields – HTML in functions.php › Reply To: Displaying Fields – HTML in functions.php
It would, just use the same method as the first with 4 conditionals
$price1 = get_field( 'foo' );
$link1 = get_field( 'bar' );
if( $price1 && $link1 ) {
$return .= '<a href="' . esc_url( $link1 ) . '">' . $price1 . '</a>';
}
If none of the conditionals run, $return
will be empty and you can check against that to return you default string.
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.