How to use wp_nav_menu with hashtag links?

You already hinted it yourself: When you look at wp_get_nav_menu_items() you’ll see that the resulting Array of items gets mapped over with wp_setup_nav_menu_item() – in other words, this function gets applied to each and every nav menu item. In there you can hook into the ‘wp_setup_nav_menu_item’-filter with its $menu_item argument, or use one of the … Read more

Custom Menu not functioning properly

By specifying a theme_location argument in my array, the issue was fixed: wp_nav_menu(array( ‘theme_location’ => ‘main_menu’ )); Edit For a distributed Theme, do not pass the ‘menu’ parameter to the wp_nav_menu() call. It will look for a specific slug of a user-created menu, and will override ‘theme_location’. Only ever pass ‘theme_location’.

How to create a menu item which is not a page

In Appearance » Menus, is you are using WordPress 3.7+, then from the left, under Links area, put your URL and then name the link. If you don’t want to link the menu to any physical link, then just put a hash (#) there.

Want to add different text after each menu item

You need a Custom Walker for this. In your Custom Walker you define the start of the element different, adding a span after the link: class Walker_With_Title_Menu extends Walker_Nav_Menu { function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $output .= sprintf( “\n<li><a href=”https://wordpress.stackexchange.com/questions/131521/%s”%s>%s</a><span class=”your-line”>%s</span></li>\n”, $item->url, ( $item->object_id === … Read more

Add Labels to Admin Menu ( How To )

First of all, searching with wrong keyword won’t give you any right solution. It’s a hint that, you are dealing with Admin menu, and anything under a menu drop down is called a sub menu – so you should search with something like: How to add submenu to any admin menu item + WordPress?. 🙂 … Read more

Bootstrap button menu on wordpress

The following should setup your menu with the correct classes and IDs applied to your container and ul. The codex entry for wp_nav_menu lists all the possible arguments. wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘container_class’ => ‘menu-menu-container’, ‘menu_id’ => ‘menu-menu’, ‘menu_class’ => ‘btn-group’ ) ); You can then add the required classes to the menu items … Read more