1

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?

2 Answers 2

2

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';
}
2

try this one

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

    //your code

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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