<li> <?php $text = get_sub_field('list_item'); $url = get_subfield('item_url'); if ($url) { $text = '<a href="'.$url.'" target="_blank">'.$text.'</a>'; } echo $text; ?> </li>