• Hi. I’ve got a child theme front-page.php that includes the following:

    <div class="header-image" style="background-image:url(<?php header_image(); ?>);">

    The image loads fine in my local environment, but does not load in the remote dev server. Instead, the remote server returns the absolute path to the local image file, like so:

    <div class="header-image" style="background-image:url(http://sheltermedicine-local.kbox.site/wp-content/uploads/2017/10/sheltermed-banner-v2.jpg);">

    Everything else appears to be working fine. Why might this happen?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    – Your currently used theme is not in the wordpress.org/themes/ directory:
    https://wordpress.org/themes/search/sheltermedicine/
    – If this was a custom theme, you may have to go back to your developer team and ask them to make the necessary change(s) to the theme.
    – For pro or commercial product support please contact the author directly on their site.
    – As the author is aware, commercial products are not supported in these forums. As you are their customer I am sure they will have no problem supporting you there.

    Moderator bcworkz

    (@bcworkz)

    Sounds like you copied your local DB to the remote server at some point and the remote inherited the local reference through that. If you go into the remote’s customizer and re-upload/set the header image, it should then pull from the right location.

    Mind you, I know nothing of your theme, I’m making a lot of assumptions. This is why we can’t support commercial themes here. But as a generic solution to a common issue in general, my guess is the most likely. I hope this helps.

    Thread Starter ajcowitt

    (@ajcowitt)

    Thank you for your responses. This is not a commercial theme. It’s a child theme I’m trying to create based on twentysixteen. As is no doubt evident, I am a novice. My previous WP experience is only in modifying child CSS files.

    If this is not the appropriate venue for such questions, I apologize. FWIW, I had to go into header image > header, select the previously uploaded header and click save in the Customizer, as per @bcworkz. I did that three times yesterday with no success, but a friend of mine did the same thing today and it worked. Could it have been a caching issue? That’s a rhetorical question. Thanks again for looking at it.

    Moderator t-p

    (@t-p)

    It’s a child theme I’m trying to create based on twentysixteen.

    In that case, try asking at https://wordpress.org/support/theme/twentysixteen so the theme’s developers and support community can help you with this.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘header_image(); returns local environment header image url in remote environment’ is closed to new replies.