How do I make dynamic active links on my navigation?
I want my navigation to be dynamic on all pages. So the current page is marked "active".
How do I create active links in the navigation?
There must be some way to do this, without repeating the same navigation on each page - and only adding "active" to the current page.
I have tried "include php" with the following code on the include file:
<li class = "nav-item <? php if ($ page == 'about') {echo 'active';}?>">
<a class="nav-link <?php if($page=='about'){echo'active';} ?> "; href = "../about.php"> About </a> </ li>
... and replace the "about" code on each page with the included navigation:
<? php $ page = 'about'; include ("../ includes / navigation.php"); ?>
I would like to use the WebAssist Plugin instead, but don't know how?
But I do not know if this is the optimal way?