We’re running multiple sites on Sassafras and we simply love it. However, we’ve noticed a weird issue that we can’t find a solution for.
Anchor links don’t seem to work in Sassafras under Chrome.
We’ve noticed when we built a page where we set up a table of contents with a lot of anchor links: https://www.followthemoonrabbit.com/studio-ghibli-storytelling/
And here’s a random page from our other blog where you can see that clicking on the comments doesn’t take you to #comments: https://www.urban-eve.hu/2019/05/15/hat-magacska-meg-folyton-azt-a-micsodat-nyomkodja/
Here’s everything we’ve tried to narrow down the issue:
- We’ve tested in Firefox and Edge and anchor links work for both.
- We placed anchor links in other Genesis installs we have that don’t run on Sassafras and those links work in Chrome as well.
- We tried going the h2 id=”xyz” route as well as the deprecated a name=”xyz” route. Neither work under Chrome.
- We’ve tested on pre-Gutenberg and Gutenberg-based posts, and everything is running on the latest versions of WordPress and Sassafras 2.0.5.
- Finally, we’ve talked to our host WPEngine, who looked at our error logs and potentially conflicting plugins and have not found anything.
So we’ve kind of exhausted everything. Since it works under other Genesis themes, we think there might be something in Sassafras that is preventing anchor links from working in Chrome.
I’d love to know your take on what this might be, because we’ve been staring at it for several hours now and have no idea what it might be.
Chrome is not a fan of anchor links. There is code you can add to the theme file to make it compatible with chrome browsers. Here is a link to a discussion about it, let me know if you need any help with this
Please login or Register to submit your answer