Current menu item

Are you only trying to change the text colour on hover? If you just want to change the text colour (not JUST on hover, but also just when the user is on that page). /* This targets the current page’s menu item */ .current-menu-item > a{ background-color:#123456; color: white; } /* This targets other menu … Read more

Custom Admin Menu Order

The actual slug for the WooCommerce menu item is ‘woocommerce’. So if you replace: ‘edit.php?post_type=shop_order’, // WooCommerce with: ‘woocommerce’, // WooCommerce the above code will work. I found a handy function that will display all the items in the menu array at How to remove admin menu pages inserted by plugins?. Here is the function … Read more

has_children in custom nav_walker

I have the same issue. Some answers claim that you can use $args->has_children or $args[0]->has_children, but it’s never added to $args. Sometimes, has_children is added under $args->walker->has_children, but it’s always set to false, in other words, useless… As a work around, the current template that I’m using adds a class to items that contain children … Read more

Include Max mega menu Plugin into theme

If you include a plugin directly inside a theme then it will be rejected by both the WordPress.org theme directory and ThemeForest. You should use TGMPA for including plugins with themes: http://tgmpluginactivation.com/ Further reading: http://code.tutsplus.com/tutorials/using-the-tgm-plugin-activation-library-in-your-themes–cms-20901 Using TGMPA means the plugin remains a plugin, WordPress loads it in the normal ‘plugin’ way, and users will get … Read more

Disable automatig SVG tag from menu

Copy functions.php from the parent theme into your child theme. Edit functions.php to remove the offending SVGs. NOTE: if wp_nav_menu() is called from another file (e.g., header.php), copy and edit that one instead.

Page-Linking Structure

As @Milo mentioned in his answer, you can’t and shouldn’t directly call a template file. It is a security risk, and you will no longer be able to access WordPress’s engine, so you can’t use functions such as the_permalink. To include a template part in your home.php or any where you wish, you can use … Read more

Add custom -element to wp_nav_menu

The wp_nav_menu() function has an items_wrap parameter which contains this by default: <ul id=”%1$s” class=”%2$s”>%3$s</ul> So you can pass it the above default plus any appended string: $search_form = get_search_form( false ); // Return not echo $items_wrap = ‘<ul id=”%1$s” class=”%2$s”>%3$s’; $items_wrap .= sprintf( ‘<li id=”searchItem”>%1$s</li></ul>’, $search_form ); wp_nav_menu( array( ‘items_wrap’ => $items_wrap, ) );