Support » Themes and Templates » Twenty Ten header image and https

  • Hi all,

    I am new to WordPress. I apologize if this has been covered before. I did a quick search and didn’t find anything…

    I have WordPress 3.0.1 setup in a multi-site configuration. It is installed on a CentOS Linux server and Apache is configured for SSL. FORCE_SSL_ADMIN and FORCE_SSL_LOGIN are both enabled.

    I am using the Twenty Ten theme and have uploaded custom header and background images. The problem is that these custom images are being served using http, so when I access the site using https I get a security warning.

    I’m not sure if the issue is with the Twenty Ten theme or with WordPress itself. Is there a way to force the custom images to be served via https?



Viewing 3 replies - 1 through 3 (of 3 total)
  • I have exactly the same problem, with 3.1 and now 3.2. It looks like the code for add_custom_background addes the styling to the body tag directly and uses an absolute URL there which doesn’t take https/http into account.

    anybody who sees any fun in “discussing” with devs might be willing to hop onto this and try to get it through the ticket-refusal-wall:

    ok, patch in that ticket is there, thanks to jkudish. For situations where you have an older version or can’t upgrade, put this in your functions.php:

    // fix ssl handling for background_image theme_mod
    function fix_theme_mod_background_image_ssl($url) {
    if ( is_ssl() )
    $url = str_replace( 'http://', 'https://', $url );
    $url = str_replace( 'https://', 'http://', $url );
    return $url;
    add_filter('theme_mod_background_image', 'fix_theme_mod_background_image_ssl', 10, 1);

    This is just here for people who search 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twenty Ten header image and https’ is closed to new replies.