X Pro with WPGeo Directory

Hi there

I have had this site for a couple of years now and it has worked quite well up to a few months ago when I started to get problems. I have a problem now and wonder if it is possible to prevent link with hash tag to be redirected instead of the scroll on the same page? Or is there any JS which can force redirect to the url on the click of link.

Many thanks.

Hello Eileen,

Thanks for writing in!

Hash tag links or anchor links ("#link-title") is used specifically to link to a particular section on the page. Usually anchor links is a relative url which is for the same page only. This is why once you click on it, it scrolls the page to the section which is only within the page. If you want to make sure that the hash tag will be force to a page you will need to insert a full absolute url with the hash tag for example: http://example.com/about-us#the-team.

<a href="http://example.com/about-us#the-team">The team</a>

This link will make sure that when you click on it, it will force the url to open the page and will not scroll within the page.

Hope this makes sense.

Thank you for your reply - worked a treat.

Kind regards

We are delighted to assist you with this.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.