Skip to content

Snippet: Conditionally Alter Menu Shop Icon “Style” (dropdown, overlay, shop, custom link…)

add_filter( 'wpex_menu_cart_style', function( $style ) {

	// Set button to standard shop link for homepage
	if ( is_front_page() ) {
		$style = 'store';
	}

	// Return style defined in the Customizer
	return $style;

} );
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)
Back To Top