Support » Fixing WordPress » Need help with if statement. Check if text in field

  • Resolved dfwgreg

    (@dfwgreg)


    Howdy everyone,
    For some reason, the if statement isn’t working for me. I created a custom field called twitter in the contact info under the author. It uses the_author_meta('twitter') to display the twitter username.

    I want to display an image if a user entered a username in the twitter field. How do I check if text is in a field and display it?

    Thanks,
    Gregory S.

Viewing 1 replies (of 1 total)
  • I think I solved it.

    <?php if (get_the_author_meta('twitter')) { ?><?php the_author_meta('twitter'); ?><?php } ?>

    Thanks,
    Grgeory S.

Viewing 1 replies (of 1 total)
  • The topic ‘Need help with if statement. Check if text in field’ is closed to new replies.