Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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';
}
share|improve this answer

try this one

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

    //your code

}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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