I'm currently in the process of building my WordPress theme from scratch, but I've run into a roadblock when it comes to adding custom classes to the < li > tags alongside those that are automatically generated by WordPress. Below is the code snippet that I'm working with:
<nav class="navbar">
<?php
wp_nav_menu(
array(
'theme_location' => 'header',
'container' => 'ul',
'menu_class' => 'navbar__nav-list',
)
);
?>
</nav>
The desired outcome that I'm aiming for can be seen in the code example below:
<nav class="navbar">
<ul class="navbar__nav-list">
<li class="navbar__nav-item">
<a href="#">link</a>
</li>
</ul>
</nav>
Any suggestions on how I can go about adding custom classes to the < li > tags within my WordPress-generated menu?