Title: Add default image PHP &#8211; TMA theme
Last modified: August 19, 2016

---

# Add default image PHP – TMA theme

 *  [Merla](https://wordpress.org/support/users/merla/)
 * (@merla)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/add-default-image-php-tma-theme/)
 * Hello,
 * I’m using The Morning After theme by Woothemes, but as its a free theme they 
   don’t offer any help.
    When posting you’re asked to choose an image to be displayed
   on the first page; however, if none is chosen then nothing is shown. What I would
   like is for a default image to be chosen if there’s no image uploaded/choosen
   when the user posts.
 * The code for retrieving the image looks like this:
 *     ```
       <div id="latest_post_image">
       					<?php woo_image('width=470&height=210'); ?>
       					</div>
       ```
   
 * So, how can I get it to get “default.jpg” if the woo_image is empty. Would be
   very thankful for any help.

Viewing 1 replies (of 1 total)

 *  [jkovis](https://wordpress.org/support/users/jkovis/)
 * (@jkovis)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/add-default-image-php-tma-theme/#post-1676675)
 * Looking through their code, it appears that they let you define a default thumbnail
   somewhere in the theme options page.
 * Regardless, you can try adding something like this:
 *     ```
       <?php
       $woo_image = woo_image('return=1&width=470&height=210');
       if( !is_empty($woo_image) {
         echo $woo_image;
       }
       else {
         echo get_bloginfo('template_directory').'/images/default-thumbnal.jpg';
       }
       ?>
       ```
   
 * where ‘/images/default-thumbnal.jpg’ is the path within your theme to the default
   image.

Viewing 1 replies (of 1 total)

The topic ‘Add default image PHP – TMA theme’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [jkovis](https://wordpress.org/support/users/jkovis/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/add-default-image-php-tma-theme/#post-1676675)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
