Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created March 20, 2012 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/2141490 to your computer and use it in GitHub Desktop.
Save billerickson/2141490 to your computer and use it in GitHub Desktop.
<?php
/**
* Add Blog to Breadcrumbs
* @author Bill Erickson
* @link http://www.billerickson.net/adding-blog-to-genesis-breadcrumbs/
*
* @param string original breadcrumb
* @return string modified breadcrumb
*/
function be_add_blog_crumb( $crumb, $args ) {
if ( is_singular( 'post' ) || is_category() || is_date() )
return '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . get_the_title( get_option( 'page_for_posts' ) ) .'</a> ' . $args['sep'] . ' ' . $crumb;
else
return $crumb;
}
add_filter( 'genesis_single_crumb', 'be_add_blog_crumb', 10, 2 );
add_filter( 'genesis_archive_crumb', 'be_add_blog_crumb', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment