Skip to content

Snippet: Add Breadcrumbs Under Header when Page Title is Disabled

// Add breadcrumbs under the site header if page header is disabled
add_action( 'wpex_hook_header_after', function() {
	if ( ! wpex_has_page_header() ) {
		wpex_get_template_part( 'breadcrumbs' );
	}
} );

// Set the breadcrumbs position to custom when page header is disabled
add_filter( 'wpex_breadcrumbs_position', function( $position ) {
	if ( ! wpex_has_page_header() ) {
		$position = 'custom';
	}
	return $position;
} );
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