4

I've searched the forums, but I cannot figure out exactly how to fix the mixed content error on my site to make it https.

Here is the error from chrome:

Mixed Content: The page at https://www.example.com/ was loaded over HTTPS, but requested an insecure stylesheet http://fonts.googleapis.com/css?family=Oswald:300,400,700. This request has been blocked; the content must be served over HTTPS.

I am a complete noob, and don't know where/what to change.

Please provide noob direction, thanks in advance, a resolution will allow me to launch....thanks so much!

---updated----

It didn't work (probably because of me). This is where it is in the code in the functions.php file but it didn't work (i changed the http to https on the is ssl function)

$open_sans = _x( 'on', 'Open Sans font: on or off', 'Divi' );

    if ( 'off' !== $open_sans ) {
        $font_families = array();

        if ( 'off' !== $open_sans )
            $font_families[] = 'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800';

        $protocol = is_ssl() ? 'https' : 'http';
        $query_args = array(
            'family' => implode( '%7C', $font_families ),
            'subset' => 'latin,latin-ext',
        );
        $fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" );
    }

    return $fonts_url;
}
endif;
markratledge
  • 17,322
  • 12
  • 60
  • 106
BizBrar
  • 57
  • 1
  • 1
  • 8

1 Answers1

7

Find the link for 'http://fonts.googleapis.com/css?family=Oswald:300,400,700 in your theme's functions.php file or header.php and do one of two things:

1) add an s to http, and Google will serve the font via https

or

2), remove the http: to make the link protocol agnostic, i.e. //fonts.googleapis.com/css?family=Oswald:300,400,700 This is the best method for compatibility in all cases.

Either way, that will solve the mixed content errors.

But, still learn how to use developer tools - the most basic tools for any web development - to check all loaded resources and find any others that are loading non-https, such as image links, etc. Use the developer tools in Firefox (or Firebug) or Chrome or Safari or IE.

markratledge
  • 17,322
  • 12
  • 60
  • 106
  • 1
    First off a million thanks for the explanation, I will try it out and report back to you. – BizBrar Mar 14 '16 at 02:21
  • Yes for the protocol agnostic. It really is the way to go. – random_user_name Mar 14 '16 at 03:54
  • It didn't work (probably because of me). I've updated the question with what I found. – BizBrar Mar 14 '16 at 23:27
  • Ok, so I poked around, and using Chrome developer tools, found an http reference in a plugin as Mark mentioned, so it worked! Mark - you the man, thanks so much!!! – BizBrar Mar 14 '16 at 23:44
  • Good that it worked; the Divi theme is aware of https and Google Fonts, looking at the code above; so it was something else, like you say, in a plugin. – markratledge Mar 15 '16 at 00:09