Only display link to author social media when it exists [closed]
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>’; } … Read more