HTTPS page link in menu

Ok, so I have a wordpress site with a lot of pages and menus that I’ve defined in the appearance/menus section of wordpress.

One of my pages has a little payment form on, which I’d like to link to with https://blahlbah.com/thepage.. and for all the other pages I’d like them to remain as http.

Even if I set an absolute link to the https page all the other pages being relative links become https also after you visit that page.

Is there a plugin or a hack or something to just specify that one page as https?

Cheers,
John.

3 Answers
3

You will need to convert the relative links to absolute links. You can do this in the wp_nav_menu_objects filter, which gets all menu items. Just edit the url property of each item.

Another option would be to extend the default Walker_Nav_Menu with one that overrides start_el(), so you can modify the passed $item there before you pass it to the parent start_el().

These are relative links you added yourself? If you add a link to a WordPress Page or Post via the menu editor it should be absolute by default.

Leave a Comment