Use CDN for Custom Header Image

  • noisegate95

    #4192

    Hi. Is it possible to use a CDN hosted custom header image? I was able to use the CDN for the social icons by placing the CDN url in the field, however this is not an option for the setting the URL for the header image. Thanks.

    http://blog.noisegate95.com

    Mod

    Kenneth John Odle

    #27549

    placing the CDN url in the field

    This is hotlinking. You shouldn’t do this because you are, in effect, stealing bandwidth.

    Instead, download the images to your computer, upload them to your own site’s media gallery and link to them from their (for the social sharing icons), or upload them to the header options.

    This is from Graphene’s “Top Bar Options” pane:

    Please do not hotlink the icons on the site. Download the icons you need and upload them to your server instead.

    noisegate95

    #27550

    Uh, I am not hotlinking anything. I pay for the CDN. Since my header is a little on the large side, even after smush.it, I want it to come from “my” CDN rather than my slow shared hosted server. Hence the entire point of a CDN.

    Mod

    Kenneth John Odle

    #27551

    That’s something different then. My bad. (I really must Google more. 😉 )

    You can probably override the header image in a child theme CSS, but you have have to add the !important declaration.

    Curious…why not get a faster host?

    Anonymous

    #27552

    Not recommended, but try this,

    In header.php change,

    <div id="header" style="background-image:url(<?php echo $header_img; ?>);">

    to

    <div id="header" style="background-image:url('http://image_path');">

    Replace image_path with the URL of your image hosted in a CDN server.

    noisegate95

    #27553

    I’ve tried to do that. I copied a copy of header.php over to my child theme, and made the changes mentioned above. Cleared all caches. It is still coming from local server. Should I <restore original header image> in header settings? Maybe not use the child theme header file?

    noisegate95

    #27554

    Nevermind. Seems to be working now. Thank you for your assistance.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!