Skip to content

Instantly share code, notes, and snippets.

@bizzthemes
Last active January 3, 2016 05:19
Show Gist options
  • Save bizzthemes/8415152 to your computer and use it in GitHub Desktop.
Save bizzthemes/8415152 to your computer and use it in GitHub Desktop.
Modify the Breadcrumbs
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Modify breadcrumb arguments.
add_filter( 'bizznis_breadcrumb_args', 'custom_breadcrumb_args' );
function custom_breadcrumb_args( $args ) {
$args['home'] = 'Home';
$args['sep'] = ' / ';
$args['list_sep'] = ', ';
$args['prefix'] = '<div class="breadcrumb">';
$args['suffix'] = '</div>';
$args['heirarchial_attachments'] = true;
$args['heirarchial_categories'] = true;
$args['display'] = true;
$args['labels']['prefix'] = 'You are here: ';
$args['labels']['author'] = 'Archives for ';
$args['labels']['category'] = 'Archives for ';
$args['labels']['tag'] = 'Archives for ';
$args['labels']['date'] = 'Archives for ';
$args['labels']['search'] = 'Search for ';
$args['labels']['tax'] = 'Archives for ';
$args['labels']['post_type'] = 'Archives for ';
$args['labels']['404'] = 'Not found ';
return $args;
}
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Reposition breadcrumb trail
remove_action( 'bizznis_loop', 'bizznis_do_breadcrumbs', 4 );
add_action( 'bizznis_after_header', 'bizznis_do_breadcrumbs' );
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Modify Breadcrumb Home link.
add_filter ( 'bizznis_home_crumb', 'custom_breadcrumb_home_link' );
function custom_breadcrumb_home_link( $crumb ) {
return preg_replace('/href="[^"]*"/', 'href="http://yoursite.com/home"', $crumb);
}
//* Modify Breadcrumb Blog posts label.
add_filter ( 'bizznis_blog_crumb', 'custom_breadcrumb_blog_label' );
function custom_breadcrumb_blog_label( $crumb ) {
return get_the_title( get_option( 'page_for_posts' ) );
}
//* Modify Breadcrumb Search label.
add_filter ( 'bizznis_search_crumb', 'custom_breadcrumb_search_label' );
function custom_breadcrumb_search_label( $crumb ) {
return 'Search for "' . esc_html( apply_filters( 'the_search_query', get_search_query() ) ) . '"';
}
//* Modify Breadcrumb 404 label.
add_filter ( 'bizznis_404_crumb', 'custom_breadcrumb_404_label' );
function custom_breadcrumb_404_label( $crumb ) {
return 'Not found ';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment