How can I fix a linked parent navigation issue in Shopify Ride theme?

Per a client’s request, I made a nested navigation, and they wanted to keep the parent navigation linked. While the parent navigation is still connected to a collection, it no longer directs to the collection URL when clicked once I added the child navigations below it. This seems to be a common issue and I’ve done some troubleshooting but have not had success implementing code suggestions given on other community posts (I have some basic code understanding, but am not super skilled). My client uses the Shopify Ride theme (most with the same issue are on the Dawn theme). I’d love some help on this issue from anyone who’s succeeded in fixing this issue.

Thanks

Hi @avergeront

Go to your Online store > Themes > Edit code, open header-dropdown-menu.liquid and header-mega-menu.liquid files, find those lines of code at very top of those file


    {{- link.title | escape -}}

Wrap them in this code


add above code here

So the final code will look like this


  
    {{- link.title | escape -}}
  

This worked as a solution, thank you so much!

You are very welcome, @avergeront

This also worked for me, thanks a lot!
It does not seem to work for mobile, do you have a solution for this?

Thanks in advance!