My wordpress site supports http and https. What I want to do is to add a widget when surfing over http that says something like "Surf this site secure" to show the visitor that I also have a secured version.

I don't want to force them to surf over SSL because I'm using a type of certificate that's not supported on Windows XP.

Now how can I do this?


WordPress has built-in function for this purpose - is_ssl(). http://codex.wordpress.org/Function_Reference/is_ssl

So, you should edit this widget and put something like

if ( is_ssl() ) {

} else {
    echo 'you should use ssl';

try this one

if ($_SERVER['HTTPS'] != "on") { 

    //your code


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.