WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Ten header image and https (4 posts)

  1. wonko93
    Member
    Posted 3 years ago #

    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?

    Thanks,

    Pete

  2. rfc1437
    Member
    Posted 3 years ago #

    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.

  3. rfc1437
    Member
    Posted 3 years ago #

    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: http://core.trac.wordpress.org/ticket/18005

  4. rfc1437
    Member
    Posted 3 years ago #

    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 );
    else
    $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 ;)

Topic Closed

This topic has been closed to new replies.

About this Topic