geostima
0
Q:

how to display just text if link has no url acf

<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>
0

New to Communities?

Join the community