Title: DIV Background Not Working
Last modified: August 30, 2016

---

# DIV Background Not Working

 *  Resolved [Aryan](https://wordpress.org/support/users/muhammadadilnazir/)
 * (@muhammadadilnazir)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/div-background-not-working/)
 * Hello,
 * I am using your plugin for featured images but now problem is that in my theme
   i have to fill DIV background with featured image, so if image is uploaded to
   wordpress it works fine. But if using your plugin no image is displayed or if
   displayed then wrong one is displayed.
 * The Following Code Doesn’t show anything at all:
 *     ```
       $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full', false);
       echo $src[0];
       ```
   
 * The Following Code which is suggested by you, shows every time wrong picture 
   or no picture at all:
 * `$image_src = nelioefi_get_thumbnail_src( get_the_ID($post->ID), 'full', false);`
 * Please help me how i can display correct background image, thank you
 * [https://wordpress.org/plugins/external-featured-image/](https://wordpress.org/plugins/external-featured-image/)

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

 *  Plugin Author [David Aguilera](https://wordpress.org/support/users/davilera/)
 * (@davilera)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/div-background-not-working/#post-6284866)
 * Hi!
 * The function `nelioefi_get_thumbnail_src` only takes one parameter, and it’s 
   the ID of the post whose external featured image has to be used. So, assuming
   the ID of the post is in the variable `$id`, this will give you the URL:
 *     ```
       if ( function_exists( 'uses_nelioefi' ) &&
            uses_nelioefi( $id ) ) {
         $image_url = nelioefi_get_thumbnail_src( $id );
       }
       ```
   
 * Now, how can you get the ID of the current post? It depends, but some common 
   solutions are:
 * * `$id = get_the_ID();`
    * `$id = $post->ID;`, assuming that the global variable`
   $post` is available.
 * If you take a closer look to the method you shared, you call `nelioefi_get_thumbnail_src`
   with more than one parameter and the post ID is improperly obtained (`get_the_ID(
   $post->ID)`).
 * I hope this helps!
 *  Thread Starter [Aryan](https://wordpress.org/support/users/muhammadadilnazir/)
 * (@muhammadadilnazir)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/div-background-not-working/#post-6284870)
 * Hello, yes Giving ID works, but now problem is that ID fetch the featured image
   for currently opened post on page or recent post on page……. it is not fetching
   for same post as featured image tag…

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

The topic ‘DIV Background Not Working’ 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

 * [background](https://wordpress.org/support/topic-tag/background/)
 * [div](https://wordpress.org/support/topic-tag/div/)
 * [featuredimage](https://wordpress.org/support/topic-tag/featuredimage/)
 * [picture/](https://wordpress.org/support/topic-tag/picture/)

 * 2 replies
 * 2 participants
 * Last reply from: [Aryan](https://wordpress.org/support/users/muhammadadilnazir/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/div-background-not-working/#post-6284870)
 * Status: resolved