Welcome! To use this support forum, please Login or Join Today!

   

Theme compatibility with HTTPS/SSL

{name}
Rank

Total Posts: 3

Joined 2011-05-09

PM

 
I am setting up a test site using the Onyx theme downloaded a couple of nights ago.

I purchased an SSL certificate for the domain but was initially getting warnings from Chrome saying the page is encrypted but parts of it were not using SSL.

The main issue was that the jQuery library served by ajax.googleapis.com is served over http, not https.

Unfortunately I had to edit a theme function file to fix this. Perhaps the themes could all have an option, or even better autodetect that SSL is being used and switch all links (when possible) to https.

For now I have just edited themes/onyx/lib/functions/theme.php and changed:
wp_register_script('jquery''http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'); 
to
wp_register_script('jquery''https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'); 

and the problem has gone away.

I believe code capable of this would be:

if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'])) {
    $url_prefix 
'https://';
else {
    $url_prefix 
'http://';


As usual, thanks for the great themes and taking the time to read the suggestion.
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
Thanks for the good suggestion. I've flagged this post as a to-do on next update.