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

We have SSL for our domain. But there's only one page want to use SSL to appear on (https://mydomain.com/secure-page/). All others should be regular http:// pages. So we've set siturl and homeurl both to http://domain.com and hardcoded link to secure-page.

On regular pages, all the navigation and others links appear non-ssl (http://) which is fine. But when on https://domain.com/secure-page, wp_nav_menu() returns https:// URLs for all other pages of site which we don't want. Remember, siteurl and homeurl both are http://.

Why is it returning all https:// links for nav items?

EDIT It is client's requirement unfortunately. There's only one page in site with HTTPS.

share|improve this question
Please explain why you want to do it that way. It could be that you are facing a XY Problem. – kaiser Mar 28 '14 at 7:40
Plz check EDIT. Thanks. – aceph Mar 28 '14 at 7:42
Then you need to fix the client, not WordPress. – kaiser Mar 28 '14 at 8:12
I guess the easiest way to get this done is set all the menu items manually using http://. If you want to do it programmatically, you can try a str_replace of the object $menu_item->url and wrap it in a is_ssl() condition. – Abhik Mar 28 '14 at 8:17

Your Answer


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

Browse other questions tagged or ask your own question.