Use CDN for Custom Header Image

  • noisegate95


    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.


    Kenneth John Odle


    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.



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


    Kenneth John Odle


    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?



    Not recommended, but try this,

    In header.php change,

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


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

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



    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?



    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.