Title: get_header_image() == &quot;http://remove-header&quot;
Last modified: August 30, 2016

---

# get_header_image() == "http://remove-header"

 *  Resolved [Adrien L](https://wordpress.org/support/users/adrien-l/)
 * (@adrien-l)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/get_header_image-httpremove-header/)
 * Hello folks!
 * So, I’m trying to put some conditions on whether or not to display a header image.
   I would like a header to be shown on categories if it exists, or the category
   name otherwise.
    First, I had to remove the site-wise header, so that it isn’t
   returned as default.
 * But, has_header_image() always returns true! The reason for that is that get_header_image()
   returns “[http://remove-header&#8221](http://remove-header&#8221); when the header
   is not set. I see this line of code on the get_header_image() function in wp-
   includes/theme.php:
 *     ```
       if ( 'remove-header' == $url )
           return false;
       ```
   
 * So, I presume your plugin (or maybe another one) is insidiously adding ‘[http://&#8217](http://&#8217);
   in front of this string, breaking this if statement.
 * I’ll just add another if in my theme file for now, but maybe could you do something
   about it?
 * Thanks anyway for a very good plugin!
    Adrien
 * [https://wordpress.org/plugins/unique-headers/](https://wordpress.org/plugins/unique-headers/)

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

 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/get_header_image-httpremove-header/#post-6559734)
 * I’m busy working at the moment, but I can see that I escape the URL in the file
   inc/class-unique-headers-taxonomy-header-images.php. I wasn’t aware that could
   cause any problems, but it would possibly explain the addition of “[http://&#8221](http://&#8221);
   on the front if it’s escaping something which is not a URL.
 * Perhaps try changing the line which says this in that file:
    `return esc_url (
   $url );`
 * and replace it with this:
    `return $url;`
 * If that fixes your problem, please let me know and I’ll fix the official plugin
   to accommodate this issue.
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/get_header_image-httpremove-header/#post-6559935)
 * Did the solution I suggested work?
 *  Plugin Author [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * (@ryanhellyer)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/get_header_image-httpremove-header/#post-6559936)
 * The latest version of the plugin should fix this problem, so no need to follow
   the suggestion above now.

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

The topic ‘get_header_image() == "http://remove-header"’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/unique-headers_c1b4ac.svg)
 * [Unique Headers](https://wordpress.org/plugins/unique-headers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/unique-headers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/unique-headers/)
 * [Active Topics](https://wordpress.org/support/plugin/unique-headers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/unique-headers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/unique-headers/reviews/)

## Tags

 * [condition](https://wordpress.org/support/topic-tag/condition/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ryan Hellyer](https://wordpress.org/support/users/ryanhellyer/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/get_header_image-httpremove-header/#post-6559936)
 * Status: resolved