Skip to content

Fixed Header Instead of Menu For Header Style Two, Three and Four

Important

By default, header styles two, three, and four make only the menu sticky rather than the entire header with the logo. Because these header styles are fairly tall, this approach creates a better scrolling experience. If you still want the entire header (including the logo) to be sticky, you can use the snippet below. However, using the Header Builder is generally the better solution.

/**
 * Filters the sticky header check.
 */
add_filter( 'totaltheme/header/styles_with_sticky_support', function( array $styles ): array {
	$styles[] = 'two';
	$styles[] = 'three';
	$styles[] = 'four';
	return $styles;
} );
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)
Related Snippets
Back To Top