Hot answers tagged

2

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 = ...


2

These are almost certainly custom post types. In the definition of the custom post type, it is possible to define a menu_icon which can be a file or an icon from the iconfont. It is this menu_icon that is showing up in your admin menu. I also notice "Programs Categories" in your menu, this looks like a custom options page - which will have also been ...


1

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); });


1

one problem exists there... Wordpress has built-in page detection, to give the CSS classes to current page in menu... and if cached, then your navigation menu-items will never get "current-page" class or etc.. however, there are 2 solutions: Solution 1 Before caching, once, add classes to <a> items: function add_menu_atts( $atts, $item, $args ) { ...



Only top voted, non community-wiki answers of a minimum length are eligible