Relative Linking
-
I’m using the Widget Block plugin so I can create widgets that only display on specified pages.
What I’m finding is that it seems impossible to include a link to a page in the widget because it won’t work if it’s on a sub-page.
For example, in the widget block, I’m linking to my contact page (https://localhost/website/contact) by using
<a href="../contact">contact</a>
.On a main level page (e.g. https://localhost/website/about), it works perfectly by directing me to: https://localhost/website/contact.
But on a sub-page/child page (e.g. https://localhost/website/about/subPage), it directs me to: https://localhost/website/about/contact.
Is there a way to use relative addressing so that I can link to my contact page no matter which page the widget is located on? I know absolute addressing is an option, but replacing all of those links when I go live is a pain (even with the Search & Replace plugin).
Any help would be appreciated.
- The topic ‘Relative Linking’ is closed to new replies.