Archived topic
Remove anchor links from url
5 replies · Started by Karim on January 20, 2017
Howdy:)
https://www.ht-installaties.nl/
I just finished my first site with Elementor Pro and GP, and it's a nice combination indeed.
When i was building the one-page site on a subdomain and scrolled to a particular anchor, the URL stayed the same. But now that i moved to the main domain, the anchor becomes visible in the url. So when i scroll to contact, you see the url like this ht-installaties.nl/#contact
is there a simple way to keep the anchor links out of the url as was before?
If it's too much trouble then dont bother, i'll keep it like this. But if it's easy (which i am sure is for you guru's :p) then i really love the help:)
Greets
Not sure if it would be simple but maybe give the solution in this post a shot?
http://stackoverflow.com/questions/5928435/append-remove-anchor-name-from-current-url-without-refresh
i visted that site so many times, always with a quick run away cause too tough to understand haha.
But i'll check it out and see.
Thanks:)
You would definitely need to use javascript to achieve something like that. There's some decent solution in the link Leo posted.
I never added javascript to a site, so always good to learn.
Can i use a hook for that, same way as i use for PhP scripts?
You can use the wp_footer hook in GP Hooks, just wrap your JS in <script></script> tags.