Test Quadmenu for Free Right Away
Documentation
Home » Developers » Frontend Hooks

Frontend Hooks

If you even want to make a deeper customization, you can also change the HTML and attributes of the items in the menu.

Change Link Classes

If you want to add your custom classes on the QuadMenu items, you can use this hook.

add_filter('quadmenu_nav_menu_css_class', 'my_hook_nav_menu_css_class', 10, 4);

function my_hook_nav_menu_css_class($classes = array(), $item, $args, $depth) {

 $classes[] = 'my_custom_class';

 return $classes;
}

Change the LESS files

If have not been enough to integrate QuadMenu with your theme, then you can make a radical change in the style.

As we’ve previously mentioned in the documentation, the QuadMenu style is created dynamically each time the user makes a change in the administration panel.

So if you want to radically change the menu style you’ve to modify the LESS files that are used to create it.

To do this, you have to change the LESS files in the compiler. Thus, you can upload files from your theme and make any changes you think necessary.

add_filter('quadmenu.compiler_files', 'my_hook_compiler_files');

    function my_hook_compiler_files($files) {

        $files = array();
        $files[] = get_template_directory() . '/quadmenu-locations.less';
        $files[] = get_template_directory() . '/quadmenu-widgets.less';

        return $files;
    }

Change link HTML output

If has not been enough for you, you can hook the HTML output with this filter.

add_filter('quadmenu_nav_menu_start_el', 'my_hook_nav_menu_start_el', 10, 4);

function my_hook_nav_menu_start_el($output = '', $item, $args, $depth) {
 return $output;
}
add_filter('quadmenu_nav_menu_end_el', 'my_hook_nav_menu_end_el', 10, 4);

function my_hook_nav_menu_end_el($output = '', $item, $args, $depth) {
 return $output;
}

Test Quadmenu for Free Right Away

Experience the ultimate WordPress menu solution. Customize, organize, and enhance your site’s navigation effortlessly.

“The support team are really helpful and quick at finding any resolutions...”

Richard LongmuirUX Engineer
Log into your account
Forgot your password?