Skip to content

Snippet: Conditionally Disable/Enable The “Togglebar”

add_action( 'wpex_toggle_bar_active', function( $bool ) {

	// Disable on blog archives (category/tag/date/author/blog template/format archives)
	if ( wpex_is_blog_query() ) {
		$bool = false;
	}

	// Return display
	return $bool;

} );
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