Breadcrumb Trail: Reloaded
I've been hard at work tonight beefing up the breadcrumb trail to take advantage of all kinds of scenarios. Here's a list of some of the changes:
- Recognizes any hierarchical taxonomy.
- Works with hierarchical post types.
- Ability to add any taxonomy for a singular "post" (any post type) view.
- Smart path handling (see below).
The last part needs some explanation and is at the heart of the changes.
Let's suppose you have a custom taxonomy with a structure like this:
Your breadcrumb trail would normally read:
Home / Will Smith
Not very good, right? I wanted to make that better. So, if you create a page called Actors (slug of
actors), you'll get this trail instead:
Home / Actors / Will Smith
This type of thing will work with all sorts of structures and any post type or taxonomy.