WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using site_url() for my href for anchors. I want to control what when I send the user to a secure page or non secure page. I thought I could do that with site_url('/foo', 'http') and site_url('/bar', 'https') but the scheme is not changing. If I'm on a secure page and site_url('/foo', 'http') is set, the clicked page is still secure instead of non-secure.

share|improve this question
up vote 0 down vote accepted

What is original link?

var_dump( get_option('siteurl') );

If I am interpreting code right then for http protocol argument action is to not change the link. So if you have set up URL to be secure by default then function doesn't override that.

share|improve this answer
Yeah at this point in the site the site url is https. I'm guessing it changes the is_SSL() return. – Clutch Apr 21 '11 at 20:20

Your Answer


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.