Add class to current category menu item

You can use is_category() You can check the documentation here function show_parent_categories( $args = array() ) { $args = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $category->term_id, ‘taxonomy’ => ‘product_cat’ ); $product_categories = get_terms( ‘product_cat’, $args ); $count = count($product_categories); if ( $count > 0 ){ echo “<div id=’main-categories-wrapper’><ul id=’main-categories’>”; … Read more

How can I stop wp_nav_menu from returning extraneous root links?

<h1><a href=”https://wordpress.stackexchange.com/questions/241420/<?php echo home_url();?>”><?php bloginfo(‘name’); ?></h1> Soooo I forgot to close my link tag in my header. Deeerp. Lol <h1><a href=”https://wordpress.stackexchange.com/questions/241420/<?php echo home_url();?>”><?php bloginfo(‘name’); ?> </a> </h1> closing the tag fixes the issue.

How to let the role “editor” to control the menu?

Add this to your functions.php // Allow editors to see Appearance menu $role_object = get_role( ‘editor’ ); $role_object->add_cap( ‘edit_theme_options’ ); function hide_menu() {       // Hide theme selection page     remove_submenu_page( ‘themes.php’, ‘themes.php’ );       // Hide widgets page     remove_submenu_page( ‘themes.php’, ‘widgets.php’ );       // Hide customize page     global $submenu;     unset($submenu[‘themes.php’][6]);   }   add_action(‘admin_head’, ‘hide_menu’); … Read more

Display Username as parent menu item

Works fine for me, nothing is replaced, it’s just appended to the navigation. Are you sure that it’s not just a styling-issue? Have you looked at the document source to check if it really is replacing the other menu items? What exactly do you mean by making it the parent item? Do you want to … Read more

Menu Underline shows without Hover after adding subitems

.nav-menu .current-menu-ancestor > a {text-decoration:none} will help. Alternatively, use .nav-menu .current-menu-ancestor > a {text-decoration:none !important;}. Please change the .nav-menu with the class name that you have used Please let me know if it works.