Skip to content

Snippet: Remove Breadcrumbs from Custom Page Header Title with Background

By default the theme breadcrumbs display on the site regardless of the page header title style you are using. However, it's possible to conditionally disable the breadcrumbs if you wanted. The following snippet shows how you can disable the breadcrumbs when the page header style is set to "Background Image".

/**
 * Remove breadcrumbs from the site when using the Page Header Title with Background style.
 *
 * @link https://totalwptheme.com/docs/snippets/remove-breadcrumbs-from-custom-page-header-title-with-background/
 */
add_action( 'wpex_has_breadcrumbs', function( $check ) {
	if ( 'background-image' === wpex_page_header_style() ) {
		$check = false;
	}
	return $check;
} );
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