Combine multiple menus using the filter wp_nav_menu_items

Thankful to the Lord, I found a solution for anyone else that comes across this issue. I took this function from the WordPress codex and modified it to soot my needs function get_menu($menu_name) { $menu_items = wp_get_nav_menu_items($menu_name); $menu_list=””; $count = 0; $submenu = false; foreach( $menu_items as $menu_item ) { $link = $menu_item->url; $title = … Read more

Bootstrap Nav Walker Sub Menu Image

Do you want the same image for each menu item? .menu-item a:before { content: url(“/path/to/image.png”); display: inline-block; } The menu items should already have an ID on each <li> li#menu-item-274 a:before { content: url(“/path/to/another/image.png”); } Failing that, you can implement your own Bootstrap Navwalker and add whatever classes or images you like. See: https://developer.wordpress.org/reference/classes/walker/ and … Read more

wordpress walker add class to submenu a href

There are special filters for adding classes to the ul, li, or a tags in a menu. For the a tags you want to use nav_menu_link_attributes. This allows you to modify all attributes on the a tag, so here’s an example: function my_nav_menu_link_attributes( $atts, $item, $args ) { if ( ‘main’ === $args->theme_location ) { … Read more