There are several ways of calling Breadcrumb NavXT’s breadcrumb trail. The first decision is between using the included widget, or calling one of the bcn_display*
functions. This guide covers some examples for calling the breadcrumb trail using the bcn_display()
function.
Continue reading
Tag Archives: Breadcrumb NavXT
Tutorials, How Tos, and Breadcrumb NavXT News
Order Bender 0.7.0
Introducing Order Bender 0.7.0. This version adds code that takes advantage of new features in Breadcrumb NavT 5.4, allowing terms without parents to be the the preferred term for a post’s hierarchy as presented by Breadcrumb NavXT.
I know I said in the last release that Order Bender will make it into the official WordPress.org plugin repository so everyone will get update notifications. The truth is, it likely will not make it into the WordPress.org plugin repository. The Breadcrumb NavXT specific functionality introduced in this version will make its way into a Breadcrumb NavXT extension plugin. So, you’ll have to manually update (by first deleting and then re-installing).
Installation is quite easy:
- Download the Master branch zip archive from GitHub
- In your WordPress Dashboard navigate to the plugin uploader (Plugins > Add New > Upload)
- Upload the zip archive
- Activate and enjoy!
You can keep up with day to day development via the Order Bender’s GitHub Repository.
-John Havlik
[end of transmission, stay tuned]
Remove the Link in a Breadcrumb
A topic that comes up time to time in support requests is how to unlink a breadcrumb. Typically this is due to having an empty page that exists to facilitate a logical hierarchy. Naturally, linking to this blank page in the breadcrumb trail is not useful. While it is bad form to have a breadcrumb in the breadcrumb trail that is not linked, there is a filter that can facilitate this behavior.
The presented solution is a simplistic example for a single page. However, it can be extended for multiple pages, or taxonomy terms. Finally, rather than being hard-coded, the IDs could come from a post_meta/term_meta field.
The Code (Breadcrumb NavXT 6.5)
Introduced in Breadcrumb NavXT 6.5, the bcn_breadcrumb_linked
filter makes changing the linked status quite simple:
add_filter('bcn_breadcrumb_linked', 'my_breadcrumb_url_stripper', 3, 10);
function my_breadcrumb_url_stripper($linked, $type, $id)
{
if(in_array('post-page', $type) && (int) $id === MYPAGEID)
{
return false;
}
return linked;
}
The Code (Pre-Breadcrumb NavXT 6.4)
Due to changes introduced in Breadcrumb NavXT 6.4, the below only works with versions of Breadcrumb NavXT prior to 6.4:
add_filter('bcn_breadcrumb_url', 'my_breadcrumb_url_stripper', 3, 10);
function my_breadcrumb_url_stripper($url, $type, $id)
{
if(in_array('post-page', $type) && (int) $id === MYPAGEID)
{
$url = NULL;
}
return $url;
}
After placing this code into your site specific plugin, you will need to update one part of it. Just replace MYPAGEID with the ID of the page you want to remove the link to. That’s it. Simple, right?
-John Havlik
[end of transmission, stay tuned]
Breadcrumb NavXT bbPress Extensions 1.1.0
Announcing the immediate availability of Breadcrumb NavXT bbPress Extensions 1.1.0. This version add support for listing the current forum’s breadcrumb when viewing a single topic instance. Additionally, bbPress Extensions will no longer swap out the topics archive breadcrumb for the forums archive breadcrumb when on a topic archive. These two changes facilitate the generation of more accurate, and specific, breadcrumbs for bbPress resources.
You can grab the latest Breadcrumb NavXT bbPress Extensions on the Breadcrumb NavXT bbPress Extensions page. Also, checkout the GitHub repository for Breadcrumb NavXT bbPress Extensions for the latest development builds.
-John Havlik
[end of transmission, stay tuned]
Breadcrumb NavXT Title Trixx 1.1.0
Announcing the immediate availability of Breadcrumb NavXT Title Trixx 1.1.0. This version introduces an alternate title importing feature that takes the slug of existing posts and uses it as the basis of the alternate title. Additionally, this version contains a couple of bug fixes and under-the-hood code organization improvements.
Users with valid and activated license keys should receive an update notification within the WordPress dashboard and be able to use the update mechanism to update (just like with any plugin in the WordPress.org repository).
-John Havlik
[end of transmission, stay tuned]