New to if statements

I am trying to output a link to an authors google+, Facebook or twitter profile on my wordpress website. I learned from another website how to add the inputs on the user profile. I am also able to output the correct links to the authors links on each single post page. The problem I’m having is that I am using a small google+, facebook and twitter image for the link and it is on every post whether the author inputs the value or not. At that point it leads nowhere. I am trying to leave the image link blank if the user doesn’t enter a value. This is the code I used to ask for the values.

[php] // adding custom fields to WP user profile
function famousbloggers_profiles( $contactmethods ) {
// Add Google profile
$contactmethods[‘google’] = ‘Google+ URL’;
// Add Twitter
$contactmethods[‘twitter’] = ‘Twitter Handle’;
//add Facebook
$contactmethods[‘facebook’] = ‘Facebook Profile URL’;

return $contactmethods;
}
add_filter('user_contactmethods','famousbloggers_profiles',10,1);

// end of adding custom fields to WP user profile[/php]

I understand that I may need to use an if statement, however, I’m not quite sure how to create the if statements for user input.

Thanks for any help

Sponsor our Newsletter | Privacy Policy | Terms of Service