Add div at the end of wp_nav_menu function in wordpress
I want to add a div at the bottom of the wordpress wp_nav_menu so that it looks like this:
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
<div class="my-div"></div>
</ul>
I can't find a way to do this in the WordPress function document, can anyone help?
+3
Eyal binehaker
source
to share
3 answers
Try this code:
wp_nav_menu(
array(
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s <div class="my-div"></div></ul>'
)
);
+1
Yash
source
to share
Just replace with below line items_wrap
wp_nav_menu(array(
'items_wrap' => '<ul>%3$s <div class="my-div"></div></ul>',
));
+1
Noman
source
to share
Try it:
wp_nav_menu(array('items_wrap' => '<ul>%3$s <div class="my-div"></div></ul>',));
-1
Ahmer A.
source
to share