add a div at the end of wp_nav_menu function in wordpress

wp_nav_menu walker
wp_nav_menu container
wp_nav_menu items_wrap
wp_nav_menu add class
wp_nav_menu li class
wp_nav_menu after
wordpress nav menu hooks
wordpress navigation menu

I want to add a div at the bottom of the wordpress wp_nav_menu so it will look like this:

<ul>
  <li>...</li>
  <li>...</li>
  <li>...</li>

  <div class="my-div"></div>
</ul>

I can't seem to find a way to do it in the function document on wordpress, can anyone please help?

Try this code:

   wp_nav_menu( 
                 array(
                        'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s <div class="my-div"></div></ul>'
                      )
                );

php, Try this code: wp_nav_menu( array( 'items_wrap' => '<ul id="%1$s" class="%2$s" >%3$s <div class="my-div"></div></ul>' ) );. Using a Custom Walker Function. For deeper conditional classes, you’ll need to use a custom walker function (created in the 'walker' => new Your_Walker_Function argument).

Try this :

wp_nav_menu(array('items_wrap' => '<ul>%3$s <div class="my-div"></div></ul>',));

Insert a div before the wp_nav_menu, How do I go about inserting a custom div before the wp_nav_menu() adds function tumble_add_menu_wrapper($nav_menu, $begin, $end)� Note: I have updated the wp_nav_menu() function by adding fallback_cb & walker item to it. The menu_class is provided value of navbar-nav mr-autov. This completes our integration now let us check responsiveness of our menu. Checking WordPress Bootstrap Menu in Different Screen Sizes

Just Replace items_wrap with below line

 wp_nav_menu(array(
                    'items_wrap' => '<ul>%3$s <div class="my-div"></div></ul>',
                ));

wp_nav_menu() | Function, Create custom menu in your functions.php , // main menu function main_nav() { wp_nav_menu( array( 'theme_location' => 'header-menu', 'menu' => ''� add a div at the end of wp_nav_menu function in wordpress php,html,wordpress,function,menu. I want to add a div at the bottom of the wordpress wp_nav_menu so it

Add menu location at the end of the header?, Add a custom link to the end of a specific menu that uses the wp_nav_menu() function. */. add_filter('wp_nav_menu_items', 'add_admin_link', 10, 2);. function� Display Home as a Page The following example causes “Home” to be added to the beginning of the list of pages displayed. In addition, the Pages wrapped in a div element, page IDs 5, 9, and 23, are excluded from the list of pages displayed, and the pages are listed in Page Order.

Append Items to A WordPress Nav Menu, Want to add a custom navigation menu in WordPress themes? your new navigation menu by adding this code to your theme's functions.php file. How can i use the wordpress menu in the header instead of the hardcoded menu ? I took the “nav menu” code and put it in the div where my client's theme� Displays a meta box for a post type menu item.

How to Add Custom Navigation Menus in WordPress Themes, The wp_nav_menu function also provides two more optional You can also add class and id attributes, include custom items, and even� If you’re just looking to add navigation menus on your website, then simply follow our beginner’s guide on how to add a navigation menu in WordPress. The goal of this tutorial is to help DIY / intermediate users add custom navigation menus in their WordPress themes.

Comments
  • where is your PHP code ? please add wp_nav_menu code in you question.
  • Well my code is just <? php wp_nav_menu() ?>
  • Please add some explanation to your answer such that others can learn from it