Title: Require a Simple PHP (!) if-else code&#8230; I think!
Last modified: August 20, 2016

---

# Require a Simple PHP (!) if-else code… I think!

 *  Resolved [Lee G](https://wordpress.org/support/users/subminor/)
 * (@subminor)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/require-a-simple-php-if-else-code-i-think/)
 * Hi,
 * The blog section on my website currently shows a thumbnail if you attach a featured
   image. What I want to happen is for an ‘Image not available’ image to display
   if there is no set featured image.
 *  I am a newbie to php so with a few trials and lots of errors still couldn’t 
   manage it. From what I can tell, this is the piece of code I need to change from
   the loop-entry.php code:
 * _[Mangled code removed. Please post code between backticks or use the code button]_
 * I’m assuming I need something ‘else’ to tell it to display an image from a fixed
   url.
    Any help appreciated.
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [OthelloBloke](https://wordpress.org/support/users/othellobloke/)
 * (@othellobloke)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/require-a-simple-php-if-else-code-i-think/#post-2712324)
 * The following page gives a perfect example of what you need.
 * [http://codex.wordpress.org/Function_Reference/has_post_thumbnail](http://codex.wordpress.org/Function_Reference/has_post_thumbnail)
 *  Thread Starter [Lee G](https://wordpress.org/support/users/subminor/)
 * (@subminor)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/require-a-simple-php-if-else-code-i-think/#post-2712329)
 * Yep.. Thats perfect. Thanks.
 * 😀

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Require a Simple PHP (!) if-else code… I think!’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Lee G](https://wordpress.org/support/users/subminor/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/require-a-simple-php-if-else-code-i-think/#post-2712329)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
