I’m using code from an earlier post on here to make sure the ‘current’ class is applied to the master page when sub pages are active.
The code works, however the ‘homepage’ link in the nav bar is also always highlighted.
Here is the code I’m using;
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
var curUrl = location.pathname;
$('a').each(function() {
$(this).toggleClass('w--current', curUrl.indexOf($(this).attr('href')) != -1);
});
});
</script>
Any suggestions on what I need to do?
Here is my site Read-Only: LINK
(how to share your site Read-Only link)