Issue
I need to add a title to my menu, which is being built by wp_nav_menu...something like this:
<div class="container">
<div class="title">My Menu Title</div>
<ul class="menu">
<li class="item"><a href="#">Item 1</a></li>
<li class="item"><a href="#">Item 2</a></li>
<li class="item"><a href="#">Item 3</a></li>
</ul>
</div>
I find it strange that this isn't included by default :s
Solution
This should work for you!
wp_nav_menu(
array(
'items_wrap' => '<div class="title">Your menu title</div><ul class="%2$s">%3$s</ul>'
)
);
Answered By - Anonymous Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.