Goal: I need the element on the menu/nav links to be highlighted based on the current active page. Example - viewing "About" page will highlight the "About" item on the menu.
What I've tried: highlight active element based on active page made the most sense but:
- It's not adding the class based on page being viewed. I added the variable on the .php template file and the Wordpress page created from dashboard itself but both don't work.
Any suggestions on how to accomplish this?
Wordpress Dashboard Page: About custom template file: About.php
Menu items:
<div>
<a class="(add class here based on page url)">About</a>
<a class="(add class here based on page url)">Blog</a>
<a class="(add class here based on page url)">Products</a>
<a class="(add class here based on page url)">Contact</a>
<div>