Title: [Plugin: Recent Posts Slider] Outputs image when one doesn&#039;t exist
Last modified: August 20, 2016

---

# [Plugin: Recent Posts Slider] Outputs image when one doesn't exist

 *  Resolved [ZeroGravity](https://wordpress.org/support/users/zerogravity/)
 * (@zerogravity)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/plugin-recent-posts-slider-outputs-image-when-one-doesnt-exist/)
 * If there is no image in any of the three places the plugin checks it still tries
   to display an image.
 * `<img src="http://dev.mydomain.com/wp-content/uploads" align="left" />`
 * Can someone suggest what code I should add where so it will not output the img
   tag if no image exists.
 * [http://wordpress.org/extend/plugins/recent-posts-slider/](http://wordpress.org/extend/plugins/recent-posts-slider/)

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

 *  Thread Starter [ZeroGravity](https://wordpress.org/support/users/zerogravity/)
 * (@zerogravity)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/plugin-recent-posts-slider-outputs-image-when-one-doesnt-exist/#post-2088406)
 * I found and fixed the problem. At line 859 I replaced
 *     ```
       if( !empty($post_details[$p]['post_first_img']['0']) || !empty($post_details[$p]['post_excerpt'])){
   
       	$rps_img_src_path = $upload_dir['baseurl'].$post_details[$p]['post_first_img']['0'];
   
       	$output .= '<a href="'.$post_details[$p]['post_permalink'].'"><img src="'.$rps_img_src_path.'" align="left" /></a>';
   
       	$output .= $post_details[$p]['post_excerpt'];
   
       }
       ```
   
 * with
 *     ```
       if( !empty($post_details[$p]['post_first_img']['0'])){
   
       	$rps_img_src_path = $upload_dir['baseurl'].$post_details[$p]['post_first_img']['0'];
   
       	$output .= '<a href="'.$post_details[$p]['post_permalink'].'"><img src="'.$rps_img_src_path.'" align="left" /></a>';
   
       }
   
       if (!empty($post_details[$p]['post_excerpt'])) {
   
       	$output .= $post_details[$p]['post_excerpt'];
   
       }
       ```
   
 *  Plugin Author [Neha](https://wordpress.org/support/users/nehagoel/)
 * (@nehagoel)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/plugin-recent-posts-slider-outputs-image-when-one-doesnt-exist/#post-2088621)
 * Perfect.

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

The topic ‘[Plugin: Recent Posts Slider] Outputs image when one doesn't exist’ is
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/recent-posts-slider_a3875c.svg)
 * [Recent Posts Slider](https://wordpress.org/plugins/recent-posts-slider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/recent-posts-slider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/recent-posts-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/recent-posts-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/recent-posts-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/recent-posts-slider/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Neha](https://wordpress.org/support/users/nehagoel/)
 * Last activity: [14 years, 12 months ago](https://wordpress.org/support/topic/plugin-recent-posts-slider-outputs-image-when-one-doesnt-exist/#post-2088621)
 * Status: resolved