yulichka
Member
Posted 1 year ago #
Hello!
I'm trying to re-work a hard-coded navigation menu into one that is controlled by WordPress.
The basic setup of the hard-coded menu is:
<div id="nav">
<ul>
<li><a>About Us</a>
<div class="flare">
<ul>
<li></li>
</ul>
</div><!--END .flare-->
</li>
</ul>
</div><!--END #nav-->
What I'm particularly after is the <div class="flare"> around the secondary ul. Is it possible to add that to a wp_nav_menu? I'm using Starkers and modifying as I go along.
Any help would be greatly appreciated. Thanks!
camelman
Member
Posted 1 year ago #
yulichka
Member
Posted 1 year ago #
Thank you so much for the tutorial, I'll give it a try.
Really, really appreciate it. Cheers!
yulichka
Member
Posted 1 year ago #
Just as a note for anyone who ends up with the same problem, here is the code I ended up using for the custom walker:
class Walker_Page_Custom extends Walker_Nav_Menu {
function start_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<div class='flare'><ul>\n";
}
function end_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul></div><!--flare -->\n";
}
}
Thanks again for the help