1 comment

  1. This is a very simple PHP issue, unrelated to WordPress. You need to check if the value is empty before echoing it. So, store them as variables first:

    $twitter  = get_the_author_meta('twitter', $author_id);
    $facebook = get_the_author_meta('facebook', $author_id);
    //etc
    

    Then check them before displaying:

    if(!empty($twitter)) {
        echo '<a title="Follow me on Twitter" href="'.$twitter.'"><img src="twitter.png" alt="" /></a>';
    }
    if(!empty($facebook)) {
        echo '<a title="Follow me on Facebook" href="'.$facebook.'"><img src="facebook.png" alt="" /></a>';
    }
    //etc
    

Comments are closed.