Navigation menu not visible (contrast issue) on home page

If you inspect the element, you’ll see that header has a different background color than other pages which is transparent. Your nav elements color is also white and that is why you can’t see the menus on home page but actually the menu is there. Just change the header background color to #000 as you … Read more

wp_nav_menu not working correctly in my underscores theme

If found out that this is removing my menu: function add_menu_icon ( $items, $args ) { if ( $args->theme_location == ‘primary’ ) { $elements=”<li class=”custom-logo”>” . get_custom_logo() . ‘</li>’; $elements .= $items; $items = $elements; return $items; } } add_filter( ‘wp_nav_menu_items’, ‘add_menu_icon’, 10, 2 ); I still haven’t figured out why.

WP admin style not refreshing

A more standard way to enqueue stylesheets in WP admin is to use wp_enqueue_style function on admin_enqueue_scripts hook. if I do any changes afterwards it doesnt update This sounds like a browser cache isssue. You can bust the cache by adding a dynamic version number parameter to the stylesheet url with the native php function … Read more

Problem in applying active class to wordpress menu

Change your active class name in your css. WordPress adds the following active classes, depending on the context of the active state: current-menu-item, current-menu-ancestor, current-menu-parent, and current-page-ancestor

Wrapping menu’s top-level link and sub-menus in div

This would do it: class My_Walker_Nav_Menu extends Walker_Nav_Menu { private $_before = null; public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { // Backup the original “before”, if any. if ( null === $this->_before ) { $this->_before = $args->before; } // Now add the wrapper div, if applicable. … Read more

Adding toggle-able element after menu item

You can easily add any HTML element to all menu items that have children by extending the Walker_Nav_Menu core class. The code below will add <i> icon element just after menu item </a> tag but you can of course change that if you need them inside or somewhere else by changing the $item_output variable. function … Read more