Title: Fallback image
Last modified: September 1, 2016

---

# Fallback image

 *  Resolved [Marlimant](https://wordpress.org/support/users/marlimant/)
 * (@marlimant)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/fallback-image-5/)
 * Hello and thanks for the plugin, the best.
 * Sometimes external images url goes down.
    There is any way to define a default
   image to avoid a blank square?
 * Best regards,
 * Marlimant.
 * [https://wordpress.org/plugins/external-featured-image/](https://wordpress.org/plugins/external-featured-image/)

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

 *  Thread Starter [Marlimant](https://wordpress.org/support/users/marlimant/)
 * (@marlimant)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/fallback-image-5/#post-7539954)
 * I found a solution:
 * *** Go to
 * …/external-featured-image/includes/nelio-efi-main.php
 * *** On line 167 replace:
 *     ```
       else {
   
       	$html = sprintf(
   
       		'<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" ' .
   
       		'style="background:url(\'%s\') no-repeat center center;' .
   
       		'-webkit-background-size:cover;' .
   
       		'-moz-background-size:cover;' .
   
       		'-o-background-size:cover;' .
   
       		'background-size:cover;' .
   
       		'%s%s" class="%s wp-post-image nelioefi" '.
   
       		'alt="%s" />',
   
       		$image_url, $width, $height, $additional_classes, $alt );
   
       	}
   
       	return $html;
   
       }
       ```
   
 * *** by:
 *     ```
       else {
   
       	$html = sprintf(
   
       		'<div class="my-class"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" ' .
   
       		'style="background:url(\'%s\') no-repeat center center;' .
   
       		'-webkit-background-size:cover;' .
   
       		'-moz-background-size:cover;' .
   
       		'-o-background-size:cover;' .
   
       		'background-size:cover;' .
   
       		'%s%s" class="%s wp-post-image nelioefi" '.
   
       		'alt="%s" /> </div>',
   
       		$image_url, $width, $height, $additional_classes, $alt );
   
       	}
   
       	return $html;
   
       }
       ```
   
 * *** Then in CSS stylesheet give a style to .my-div class, for example:
 * > .my-div{background:#003f5f url(“[http://my-domain.com/wp-content/themes/Extra_Noticias_Wide/images/header-background.jpg&#8221](http://my-domain.com/wp-content/themes/Extra_Noticias_Wide/images/header-background.jpg&#8221);)
   > no-repeat scroll 0 0; background-size:cover;}
 *  Plugin Author [David Aguilera](https://wordpress.org/support/users/davilera/)
 * (@davilera)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/fallback-image-5/#post-7539966)
 * Hi!
 * I’m glad to know you could find the solution. Just one quick notice: in the HTML,
   you added a `<div>` tag whose class is `my-class`:
 *     ```
       <div class="my-class"><img src....
       ```
   
 * but in your CSS, you’re referring to a different class (`my-div`):
 *     ```
       .my-div {
         background: ...
       }
       ```
   
 * So, anyone trying to implement this solution, make sure that you use the same
   class in both the HTML code and the CSS rule.
 * Warm regards,
    David
 *  Thread Starter [Marlimant](https://wordpress.org/support/users/marlimant/)
 * (@marlimant)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/fallback-image-5/#post-7539967)
 * Unfortunately I can not change the comments after a while, so your observation
   is very welcome. Thank you David!
 *  Plugin Author [David Aguilera](https://wordpress.org/support/users/davilera/)
 * (@davilera)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/fallback-image-5/#post-7539968)
 * You’re welcome! Glad I could help 🙂

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

The topic ‘Fallback image’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/external-featured-image_947a5f.svg)
 * [Nelio External Featured Image (discontinued) - Available in Nelio Content](https://wordpress.org/plugins/external-featured-image/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/external-featured-image/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/external-featured-image/)
 * [Active Topics](https://wordpress.org/support/plugin/external-featured-image/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/external-featured-image/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/external-featured-image/reviews/)

## Tags

 * [default](https://wordpress.org/support/topic-tag/default/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * 4 replies
 * 2 participants
 * Last reply from: [David Aguilera](https://wordpress.org/support/users/davilera/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/fallback-image-5/#post-7539968)
 * Status: resolved