I've created a custom nav in html/css and have applied it to my header.php file in wordpress (with all the page links linking to my html pages). How would I use this nav style as my main nav? ie. whenever I create a page, the page link goes onto the nav? I've tried deleting all the html links but it doesn't seem to work. Here's a link to the site at the moment: http://ixd487.firebird.sheridanc.on.ca/wordpress/
Below is what I pasted into the nav section in my header.php
<!-- nav -->
<nav class="navbar navbar-expand-lg navbar-dark navbar-site sticky-top0 nav-fill0 navbar-lg0 navbar-transparent0" role="navigation">
<div class="container">
<button class="navbar-toggler site-toggler collapsed" type="button" data-toggle="collapse" data-target="#siteMenu" aria-controls="siteMenu" aria-expanded="false" aria-label="Toggle navigation">Menu</button>
<div class="collapse navbar-collapse" id="siteMenu">
<ul class="navbar-nav mr-auto">
<li class="nav-item home-icon">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="whymac.html">Why McMaster?</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="co-op.html">Co-Op/Internships</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="summergrad.html">Summer & Recent Grads</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="funding.html">Funding</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="https://mps.mcmaster.ca/_staging/bw/elements/#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Recruitment
</a> <div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="careerfairs.html">Career Fairs</a>
<a class="dropdown-item active" href="infosessions.html">Information Sessions</a>
</div>
</li>
<li class="nav-item ">
<a class="nav-link" href="postnow.html">Post Now</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<?php html5blank_nav(); ?>
<!-- /nav -->
I've been doing this on my website. First, in functions.php
Next, in an
includes
folder, I useassets/includes
. You should use a bootstrap walker menu: https://github.com/wp-bootstrap/wp-bootstrap-navwalkerNow, in your header.php:
It should create a dynamic boostrap menu.
I have reviewed your website but could not find ul with class "navbar-nav mr-auto" as you have mentioned above. Also instead of adding static navigation, use Bootstrap NavWalker to integrate Bootstrap menu with WordPress.
https://github.com/wp-bootstrap/wp-bootstrap-navwalker