Display navigation menu item conditionally based on user capabilities
Use your own walker and check the capability before you create an item.
Use your own walker and check the capability before you create an item.
here is a quick code that should do the job, paste this in your theme’s functions.php file basically what it does is hide all regular class input boxes and adds a new select dropdown which changes the value of the hidden input based on the selected value. and it looks like this; function menu_item_class_select(){ global … Read more
I was able to add a “parent” CSS class to the anchor tag of menu items who have children by following this answer: Add ‘has_children’ class to parent li when modifying Walker_Nav_Menu Here’s an example: class Main_Nav extends Walker_Nav_Menu { /** * @see Walker::start_el() * @since 3.0.0 * * @param string $output Passed by reference. … Read more