• I found a tutorial online that shows how you can create a custom field for authors to enter, like Twitter (link). What I want to do is display a link to their Twitter account IF they entered it. If not, display a different link.

    How can I accomplish this? It seems like it is a simple task. I am really new to WordPress theme and PHP, so please be as clear as you can. Thank you very much! I really appreciate it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try something like:

    <?php if(isset($_GET['author_name'])) $curauth = get_userdatabylogin($author_name);
    else $curauth = get_userdata(intval($author));?>
    <?php if( get_the_author_meta('twitter', $curauth->ID) != '') :?>
    <p class="twitter"><?php _e('Twitter');?>: <span><?php the_author_meta('twitter', $curauth->ID);?></span></p>
    <?php else:?>
    <p class="no-twitter">blah blah</p>
    <?php endif;?>
    Thread Starter Connor Crosby

    (@ccmovies)

    Excellent, I will try that out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘IF Author Contact Field Entered, Display Link – How?’ is closed to new replies.