Support

Account

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.