Nav menu classes ‘has-dropdown’ but no ‘active’

Can you add the complete output code for the navigation menu. The code you pasted seems to be a stripped version. Moreover, WordPress adds ‘current_page_item’ class to the list item if it is currently being viewed. For more info, check this WordPress documentation on classes added to Navigation menu items.

WordPress Custom Menu Admin helper plugin

Add this to functions.php, or put the CSS into a css file which is loaded in the admin screen. This will let the box become resizable, so you can make it taller and see more pages/checkboxes at once. function wp191833_resize_menu_list() { ?> <style type=”text/css”> #wpwrap .categorydiv div.tabs-panel, #wpwrap .customlinkdiv div.tabs-panel, #wpwrap .posttypediv div.tabs-panel, #wpwrap .taxonomydiv … Read more

How to have multiple WordPress Menus

There are a few steps you need to take to add menus, the wordpress way. Register the menu in functions.php using register_nav_menus() Codex Link: https://codex.wordpress.org/Function_Reference/register_nav_menus Example: register_nav_menus( array( ‘my_custom_menu’ => ‘My Custom menu’, ‘my_other_menu’ => ‘My Other Menu’, ) ); Now you can create new menus on the back-end Login and go to Appearance -> … Read more

Adding CSS-class to WordPress Menu in backend

I made it different for that project. Using ACF Pro (anyway) + a mod of “Code Area“. Return that Code Area CSS via add_action(‘admin_head’, ‘function_name’); in my admin-area. So I am able to put the IDs in my CSS field => Voilà. A different way, but works exact as I wanted/ needed.

Replace anchor tag with span tag

The following code added to your themes functions.php will do what you want. add_filter( ‘walker_nav_menu_start_el’, ‘my_walker_nav_menu_start_el’, 10, 4 ); function my_walker_nav_menu_start_el( $item_output, $item, $depth, $args ) { if ( empty( $item->url ) || ‘#’ === $item->url ) { $item_output = $args->before; $item_output .= ‘<span class=”my-class”>’; $item_output .= $args->link_before . apply_filters( ‘the_title’, $item->title, $item->ID ) . … Read more

Can you add shortcode as a menu item link?

I am not sure about the Shortcode in Menu; but Menu Walker Class is your best bet to achieve what you want. Walker Class will pass on each Menu element to your code, this is where you can catch your menu item and make the desired modal pop-up link for a href of your menu … Read more

add login menu with submenu

Here is a barebones example (which I just tested on my site): add_filter( ‘wp_nav_menu_items’, ‘asv_add_usermenu’, 10, 2 ); function asv_add_usermenu( $items, $args ) { if (is_user_logged_in() && $args->theme_location == ‘primary-menu’) { $items .= “<li class=”sub-menu”><a href=”” . wp_logout_url() . “”>Log Out</a></li>”; } elseif (!is_user_logged_in() && $args->theme_location == ‘primary-menu’) { $items .= “<li class=”sub-menu”> <a href=”” … Read more

Extend Menu Walker Output

change this line: $item_output .= $args->link_before . apply_filters(‘the_title’, $item->title, $item->ID) . $args->link_after; to: $item_output .= $args->link_before . apply_filters(‘the_title’, substr($item->title, 0, 10), $item->ID) . $args->link_after; That limits the character to 10. Please note this substr($item->title, 0, 10).