Remove unwanted elements for a wp_nav_menu

I got it to work by reconfiguring the walker class custom_menu extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : ”; $class_names = $value=””; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ‘ ‘, apply_filters( ‘nav_menu_css_class’, array_filter( … Read more

Add image to menu item with ACF

get_field() gets the field for the current post in the loop, but the loop isn’t used for menu items, so you need to specify which post you want to get the value from. In the case of menu items, each nav menu item is a WP_Post object, so you want to pass that: foreach( $items … Read more

Hide product categories and taxonomy terms in menu if empty

Not sure about the custom taxonomy, however I have used this code before to remove empty categories. You can add it to functions.php. add_filter( ‘wp_get_nav_menu_items’, ‘nav_remove_empty_category_menu_item’, 10, 3 ); function nav_remove_empty_category_menu_item ( $items, $menu, $args ) { global $wpdb; $nopost = $wpdb->get_col( “SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE count = 0” ); foreach ( $items as … Read more

Jupiter theme Mega menu option not available

I had the same issue and finally, I found the reason and the solution myself. The issue occurred due to a conflict of plugins. The latest popup maker plugin makes the mega menu checkbox invisible. To get back the checkbox in the menu, follow these steps. Popup Maker > Settings > Misc : Disable Popups … Read more