<img src="<?php bloginfo('stylesheet_directory'); ?>/images/<?php echo $curauth->yim; ?>" /> //basically displays an image file we indicate in the YIM field of a user
Now what we want it to do is "If" this field $curauth->yim; is not null "then" display <img src="<?php bloginfo('stylesheet_directory'); ?>/images/<?php echo $curauth->yim; ?>" />
but if it is null we want to pull in some fields in that are already being collected by wordpress and they are also php based like:
$author_name
<?php bloginfo('name'); ?>
So i tried writing a if else statment:
Code: Select all
<?php
if ($curauth->yim != null);
echo '<img src="' . bloginfo('stylesheet_directory'); '/images/' . $curauth->yim; '" />';
else
echo '<div id="author">' . bloginfo($author_name); '/div> <br> <div="title">' . bloginfo('name'); '</div>'
?>