How to change the ‘Second Click Behaviour’ option for a single location
The ‘Second Click Behaviour’ option is a global setting and will apply to all of your Max Mega Menu enabled menus.
To change the ‘Second Click Behaviour’ option for a single menu location, add the following to your themes functions.php file:
1 2 3 4 5 6 7 8 |
function megamenu_second_click_one_menu_location_only($attributes, $menu_id, $menu_settings, $settings, $current_theme_location) { // change 'primary' to the ID of your menu location if ($current_theme_location == 'primary') { $attributes['data-second-click'] = 'go'; // either 'go' or 'close' } return $attributes; } add_filter('megamenu_wrap_attributes', 'megamenu_second_click_one_menu_location_only', 10, 5); |