Anchor Links to another page not working in Chrome

I have seen several topics on this issue. All of the sample sites given seem to be working correctly now, but I don’t see any solutions posted.

I have a page setup that has 2 primary sections. On that page I have a link to jump to the second section. Within that page the link works fine. If I use that same link from my home page, it just goes to the top of the page rather than the id location. It works fine in Firefox or Edge, but not in Chrome. If I disable javascript in Chrome, then it works fine. There is a script somewhere that’s causing an issue but I can’t identify where or find a fix that work.

Hi pjsockett,

Can you provide us with a link?

Often times when I run into issues like this it’s due to having the ID showing up twice on the page, but without getting to see the page it’s hard to help troubleshoot.

Home page has links to girls tournament - newberlinmagic.org
Tournaments page has anchor link to girls section - newberlinmagic.org/tournaments/

There is an anchor link on the tournaments page to jump to girls and that one works fine, but when coming from a news post or from any other page it stays at the top of the page. Again, this is only an issue in Chrome.

The anchor links are setup correctly from what I can tell. However, I am not seeing anything that stands out as to why this wouldn’t be working.

However, there does appear to be a strange behavior where sometimes the heading appears to break with a “Skip to content” showing. There appears to be a 403 error that pops up with this issue on your site.

Is this a plugin?

I haven’t seen the issue that you have described, I’m not sure what that one is. It’s a site through TeamSnap with a very limited set of plugins. Primarily just Beaver Builder with the Power Pack and a few things that they added to integrate with their software. They seem pretty confident that it’s an issue with Beaver Builder and I have seen several others with the same issue in the forums here. Most of the topics end abruptly without a solution, but the sites appear to be fixed.

Have you tried deactivating Beaver Builder and see if that resolves the issue?

I don’t have that option. I have disabled javascript in the browser and it functions correctly. That tells me it’s setup correctly, but doesn’t help me determine which script is the issue.

I found a possible solution here:

Try adding this to the Layout CSS & JavaScript on the page (or in a child theme if you have access):

jQuery(document).ready(function () {
    var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
    if (window.location.hash && isChrome) {
        setTimeout(function () {
            var hash = window.location.hash;
            window.location.hash = "";
            window.location.hash = hash;
        }, 300);
    }
});

That looks like it worked for me.

I did see the issue that you mentioned before where much of the styling is gone and it says skip to content at the top of the page and I believe that has something to with changing to the javascript code and works itself out after a few minutes.

Great! Happy it worked for you :smiley:

Okay, so long as you knew it was happening.

Have a great week!

Just to say, i have the same kind of issue with a JS script blocking anchor links and/or smooth “scroll top” link in Chrome.
I identified the culprit plugin, AjaxSearch Pro latest version, but had no time or enough knowledge to troubleshoot, so i just downgraded this plugin to avoid the issue.