WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Apr 07 2011

How to Create a Custom NonHierarchical Taxonomy Breadcrumb in Genesis

Recently I had the need to create a custom taxonomy breadcrumb because my custom taxonomy was non-hierarchical (like Tags). However, the launch page for this tag was lost in the Breadcrumbs, so I needed to add it back. Since my custom taxonomy was rather simple, filtering the already existent Breadcrumb class didn't make sense to me. However, I was stumped, so I reached out to Bill Erickson on Twitter (@BillErickson). He came up with this awesome, simple solution:

[php]remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
add_action('genesis_before_loop', 'tax_breadcrumbs');

function tax_breadcrumbs() {
if (is_tax()):
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
echo '<div class="breadcrumb"><a href="'.get_bloginfo('url').'">Home</a> | <a href="/page-name">Page Name</a> | '.$term->name.'</div>';
endif;

} [/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Jonathan says

    June 15, 2013 at 12:38 pm

    Travis,

    Is this code still applicable? Or does the more recent version of Genesis account for taxonomies? Thx!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in