Snippets: Replace Breadcrumbs with NavXT Breadcrumbs

function myprefix_navxt_breadcrumbs() {

	// Breadcrumbs classes
	$classes = array( 'site-breadcrumbs', 'wpex-clr' );

	// Add position
	$position = apply_filters( 'wpex_breadcrumbs_position', wpex_get_mod( 'breadcrumbs_position', 'absolute' ) );
	$position = ( $position && 'default' != $position ) ? $position : 'absolute';
	$classes[] = 'position-'. $position;

	// Add class for breadcrumbs js for positioning the crumbs
	if ( 'absolute' == $position ) {
		$classes[] = 'has-js-fix';
	}

	// Apply filters to classes
	$classes = apply_filters( 'wpex_breadcrumbs_classes', $classes );

	// Turn classes into string
	if ( $classes && is_array( $classes ) ) {
		$classes = implode( ' ', $classes );
	}

	// Return crumbs
	return '<nav class="'. $classes .'">'. bcn_display( true ) .'</nav>';

}

if ( function_exists( 'bcn_display' ) ) {
	add_filter( 'wpex_custom_breadcrumbs', 'myprefix_navxt_breadcrumbs', 99 );
}

Version Required:3.3.5+

Snippet Type: PHP

Posted Under: Breadcrumbs

All PHP snippets should be added via a child theme's functions.php file.