Title: Displaying too much
Last modified: March 30, 2019

---

# Displaying too much

 *  Resolved [sefanjo](https://wordpress.org/support/users/sefanjo/)
 * (@sefanjo)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/displaying-too-much/)
 * Hey guys!
 * I am working on a site and I wanted to make sure that people could easily change
   the header/hero image. Therefor I wrote a tiny bit of PHP in my HTML.
 * `<div class="hero-sdc" style="background-image: url( <?php the_post_thumbnail('
   full'); ?> );">`
 * I can see and edit the picture so that is working. The only problem is that I
   can see some code/text on the picture. It is the part after I am closing the 
   PHP tag that is shown to me.
 * Does anyone know how to fix this?
 * EDIT:
    I thought that the image was showing up, in fact it does not! Can anyone
   help me getting this fixed and right?
    -  This topic was modified 7 years, 4 months ago by [sefanjo](https://wordpress.org/support/users/sefanjo/).
    -  This topic was modified 7 years, 4 months ago by [sefanjo](https://wordpress.org/support/users/sefanjo/).

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

 *  [Santiago](https://wordpress.org/support/users/sjaure/)
 * (@sjaure)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/displaying-too-much/#post-11372794)
 * Hi [@sefanjo](https://wordpress.org/support/users/sefanjo/)
    Hope you are doing
   well First problem that I notice is that you are using the wrong method to get
   the image url. Change `the_post_thumbnail('full');` (this returns the whole img
   tag) to `the_post_thumbnail_url('full');` (this returns just the image url)
 * And I guess you are already aware that this will pick the featured image for 
   the current post. (this won’t work in an archive view, for instance).
    You would
   need to add some conditional logic to check if there is an image available and
   use some kind of fallback.
 * Take care!
    -  This reply was modified 7 years, 4 months ago by [Santiago](https://wordpress.org/support/users/sjaure/).
 *  Thread Starter [sefanjo](https://wordpress.org/support/users/sefanjo/)
 * (@sefanjo)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/displaying-too-much/#post-11372893)
 * Hey,
 * Thank you! It is fixed now. 🙂

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

The topic ‘Displaying too much’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [sefanjo](https://wordpress.org/support/users/sefanjo/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/displaying-too-much/#post-11372893)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
