I am trying to display a default or no photo image when the user has not uploaded a photo of his/her own. My code is
<?php if(userphoto_exists($curauth)) userphoto($curauth); else echo '<img src="images/signer.jpg" alt="No Photo" />'; ?>
I am having success with the “if” part but not “else.” The image is not getting displayed because I am not getting the uri right (the alt text is working though). I have used the get_stylesheet_directory_uri() function in the past to get absolute path. But I am not getting it right within the “echo” command.
I don’t know PHP at all so kind of tired of all the permutations and combinations. Any help will be appreciated. Thanks.
- The topic ‘Displaying default photo’ is closed to new replies.