Skip to content

Instantly share code, notes, and snippets.

@marisqaporter
Forked from rickrduncan/author-breadcrumb.php
Last active August 29, 2015 14:19
Show Gist options
  • Save marisqaporter/ac94b64148578064e649 to your computer and use it in GitHub Desktop.
Save marisqaporter/ac94b64148578064e649 to your computer and use it in GitHub Desktop.
<?php
//* Do NOT include the opening php tag
//* Prefix author breadcrumb trail with the text 'Articles written by'
add_filter( 'genesis_breadcrumb_args', 'b3m_prefix_author_breadcrumb' );
function b3m_prefix_author_breadcrumb( $args ) {
$args['labels']['author'] = 'Articles written by ';
return $args;
}
<?php
//* Do NOT include the opening php tag
//* Change the breadcrumb separator
add_filter( 'genesis_breadcrumb_args', 'b3m_change_separator_breadcrumb' );
function b3m_change_separator_breadcrumb( $args ) {
$args['sep'] = ' &rsaquo; ';
return $args;
}
<?php
//* Do NOT include the opening php tag
//* Default arguments from the Genesis Breadcrumb
//* genesis/lib/classes/breadcrumb.php
$this->args = array(
'home' => __( 'Home', 'genesis' ),
'sep' => ' / ',
'list_sep' => ', ',
'prefix' => sprintf( '<div %s>', genesis_attr( 'breadcrumb' ) ),
'suffix' => '</div>',
'heirarchial_attachments' => true,
'heirarchial_categories' => true,
'labels' => array(
'prefix' => __( 'You are here: ', 'genesis' ),
'author' => __( 'Archives for ', 'genesis' ),
'category' => __( 'Archives for ', 'genesis' ),
'tag' => __( 'Archives for ', 'genesis' ),
'date' => __( 'Archives for ', 'genesis' ),
'search' => __( 'Search for ', 'genesis' ),
'tax' => __( 'Archives for ', 'genesis' ),
'post_type' => __( 'Archives for ', 'genesis' ),
'404' => __( 'Not found: ', 'genesis' )
)
);
<?php
//* Do NOT include the opening php tag
//* Change the word 'Home' that is at the front of breadcrumb trail
add_filter( 'genesis_breadcrumb_args', 'b3m_home_text_breadcrumb' );
function b3m_home_text_breadcrumb( $args ) {
$args['home'] = 'Home';
return $args;
}
<?php
//* Do NOT include the opening php tag
//* Reposition the Genesis breadcrumb to bottom of page
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_entry_footer', 'genesis_do_breadcrumbs' );
<?php
//* Do NOT include the opening php tag
//* Remove breadcrumb from a single page
add_action( 'genesis_before', 'b3m_remove_genesis_breadcrumb' );
function b3m_remove_genesis_breadcrumb() {
if ( is_page( 'resources' ) )
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}
<?php
//* Do NOT include the opening php tag
//* Remove 'You are here' from the front of breadcrumb trail
add_filter( 'genesis_breadcrumb_args', 'b3m_prefix_breadcrumb' );
function b3m_prefix_breadcrumb( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment