Output only links using wp_nav_menu()

This should add the drop class to all the li elements in the menu and also add your classes to the wrapping ul: function wpse_232637_add_menu_parent_class( $items ) { foreach ( $items as $item ) { $item->classes[] = ‘drop’; } return $items; } add_filter( ‘wp_nav_menu_objects’, ‘wp_232637_add_menu_parent_class’ ); $args = array( ‘menu’=>”, ‘menu_class’=>’nav navbar-nav navbar-right’, ‘menu_id’=>”, ‘container’=>false, … Read more

get only the item you click on

It’s called “event bubbling” or “event propagation” and the solution is to get the event object and use the JS stopPropagation method. Try this: jQuery(‘.menu-item’).click(function(event){ var class_id = jQuery(this).attr(‘id’); event.stopPropagation(); alert(class_id); });

Show Sidebar Menu Subpages When Clicking Parent

No need for a custom walker – it’s controlled with the depth parameter. At the moment, you’re only showing 2 levels of menus – but you need to set this to 3! This, however, will only control what is being output. As for the user clicking, hovering or otherwise to actually see the menu, you’ll … Read more

Style wp_link_pages as a select drop down list

Here’s one way to achieve that is by constructing the <option> tags with the wp_link_pages_link filter: add_filter( ‘wp_link_pages_link’, function( $link, $i ) { return sprintf( ‘<option value=”%d” %s>%d</option>’, $i, selected( $i, get_query_var( ‘page’, 1 ), 0 ), $i ); }, 10, 2 ); and then the <form> and <select> tags with the wp_link_pages filter: add_filter( … Read more

How to get submenu dropdown with images?

First of all, it’s not a WordPress related you know and there are other platform you can ask about this one, anyway, if you didn’t read this http://inspirationalpixels.com/tutorials/creating-a-dropdown-menu-with-html-css kind of article please read one. I see you changed your post summary and thanks for that. But before get answer something worth you have to try … Read more

Menu not adding the right items

You’ve defined your menu location as header_navigation. Use the menu location slug header_navigation in your call to wp_nav_menu(), not the description (nav): wp_nav_menu(array( ‘theme_location’ => ‘header_navigation’, ‘container’ => false, ‘menu_class’ => ‘nav’, ));