• Resolved iyogai

    (@iyogai)


    has_content() isn’t working on anchor tag. Whether the link has content or not, it displays none.
    Here’s an example code:

    <?php if ($this_business->has_content('instagram')) : ?>
      <a href="<?php echo $this_business->get_field_prop('instagram','link') ?>">
        <i class="fab fa-instagram"></i>
      </a>
    <?php endif ?>
    • This topic was modified 5 years, 5 months ago by iyogai.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xnau webdesign

    (@xnau)

    To check for content in a link field, you should check the ‘link’ property of the field, for example:

    <?php if ( $this_business->get_field_prop( 'instagram', 'link' ) !== '' ) :

    Thread Starter iyogai

    (@iyogai)

    Awesome, Thanks a ton

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘‘has_content’ function not working on anchor tag’ is closed to new replies.