Update body class based on menu

As @CharlesClarkson has already explained, you cannot modify the page output with PHP after the output has been sent to the browser. Your menu certainly runs after body_class since the menu must run inside the <body> tag. The only PHP solution I see would involve editing your theme templates in addition to the code above … Read more

How do you manage large menu hierarchies in WP?

It’s an issue with WP core that hierarchies don’t display in Appearance > Menu > Product Categories tab. In that ticket you can find workarounds: https://core.trac.wordpress.org/ticket/18282 For me worked partially (displayed the hierarchy to the left) this plugin, discussed in the above ticket: https://core.trac.wordpress.org/attachment/ticket/18282/preserve-page-and-taxonomy-hierarchy.php you can download it at the bottom of the page and … Read more

Schedule Page to Menu [duplicate]

I believe that this plugin will do what you want. Jamocreations Auto Submenu https://wordpress.org/plugins/auto-submenu/ Here is also a link to the author’s site, http://jamocreations.com/en/artikelen/auto-submenu , where he discusses why he built the plugin and also two other plugins that also work similarly. The advantage of the Jamocreations Auto Submenu plugin though is that if later … Read more

wp_nav_menu() with multiple Class

I don’t know what your conditions are for each class by the hook you’re looking for is nav_menu_css_class. You can use it to append classes or remove classes from each list-item <li> in the menu. /** * Modify list item classes of wp_nav_menu * – https://codex.wordpress.org/Plugin_API/Filter_Reference/nav_menu_css_class * – https://developer.wordpress.org/reference/hooks/nav_menu_css_class/ * * @param Array $classes || … Read more

How to include a third level with wp_get_nav_menu_items function

Seems that nobody has an answer to this question, so I followed @Zlatev advice and created a custom walker class… Download the plugin from GIT and add it to your theme, add the custom walker below to a include() or directly into your functions. <?php /** * Required plugin * https://github.com/adgsm/multi-level-push-menu */ class Push_Menu_Walker extends … Read more

Remove All in One Pack from the admin bar

You are almost there! If you check out where the plugin developer is adding this action, you’ll see they are setting a priority of 1000. While the priority of your function is being called at 999. https://plugins.trac.wordpress.org/browser/all-in-one-seo-pack/trunk/aioseop_class.php#L3907 Update your priority to be greater than 1000: add_action( ‘admin_bar_menu’, ‘aldous_remove_items_from_admin_bar’, 1200 ); Overriding function calls with plugins … Read more