How to hyperlink a heading within a title block on an Accordion (Nestable)

I am trying to make a mobile menu with an accordion because it transitions open and closed, and it also closes all other open tabs when a different tab is pressed. My issue is that I have made the heading in the title a link to the main page, but it does to link to the page. It just opens the tab when pressed. How can I achieve this?