Snippet: Hide Header on Mobile via PHP
The following snippet can be used to hide the main header on mobile devices.
add_filter( 'totaltheme/header/wrapper_class', function( $classes ) {
// This will hide your entire header at the mobile menu breakpoint which is 959px by default
// and can be changed under Customize > Header > Mobile Menu
$classes[] = 'hide-at-mm-breakpoint';
// Return classes
return $classes;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)