I have a simple php script that I am using to display social icons if user has provided their social network username in the fields of their user account in wordpress.
Problem is that all of the network icons are being displayed even if the networks username was not provided.
I clearly understand the reason why it is happening since all of the divs are wrapped in the same echo output, but cannot really figure out how to use isset within that echo to output if condition of each div is met individually.
I hope that my explanation of the problem is not too confusing
Here is example of my script
echo '
<div class="author_networks">
<div class="gplus"><a class="soc_btn gplus_img" href="https://plus.google.com/'. get_the_author_meta('google_plus', $authorID) .'" rel="me" target="_blank"></a></div>
<div class="facebook"><a class="soc_btn facebook_img" href="http://www.facebook.com/'. get_the_author_meta('facebook', $authorID) .'" target="_blank"></a></div>
<div class="twitter"><a class="soc_btn twitter_img" href="http://twitter.com/'. get_the_author_meta('twitter', $authorID) .'" target="_blank"></a></div>
<div class="linkedin"><a class="soc_btn linkedin_img" href="http://www.linkedin.com/company/'. get_the_author_meta('linkedin', $authorID) .'" target="_blank"></a></div>
</div>
</div>'
Thanks in advance for your suggestions
Sime
IFstatement will work: