How to Add li and Other Tags to Breadcrumb Templates

Since Breadcrumb NavXT 4.3.0, all settings that can contain HTML are passed through wp_kses(). With this change, only a basic set of acceptable tags and properties within tags were allowed. Naturally, this restricted users more than they were used to. The restriction wasn’t the biggest problem, the lack of a filter to allow users to add their own tags in to the allowed HTML tag list. However, with Breadcrumb NavXT 4.4, a new filter bcn_allowed_html has been introduced to fix this issue.

The default set of allowed HTML tags in Breadcrumb NavXT 4.4 consists of: <a>, <img>, <span>, <h1>, and <h2>. For the purposes of this guide, let’s assume you don’t want to use the built in bcn_display_list() function to output breadcrumbs wrapped in <li> tags. The reason you would want to do this is if you need additional properties within the tag (Breadcrumb NavXT will by default add a class but that’s it).

In Breadcrumb NavXT 4.4, adding a tag to the allowed HTML list for Breadcrumb NavXT is really easy. Just create a function with one input argument ($allowed_html in this example). Within that function append, using the HTML tag name as the array entry key, assign an array of properties that tag is allowed to have, using the property name as the array entry key and a value of true. Then add your filter function to the ‘bcn_allowed_html’ filter hook. Below is an example of this for the <li> tag with a selection of properties.

function my_bcn_allowed_html($allowed_html)
{
	$allowed_html['li'] = array(
		'title' => true,
		'class' => true,
		'id' => true,
		'dir' => true,
		'align' => true,
		'lang' => true,
		'xml:lang' => true,
		'aria-hidden' => true,
		'data-icon' => true,
		'itemref' => true,
		'itemid' => true,
		'itemprop' => true,
		'itemscope' => true,
		'itemtype' => true
	);
	return $allowed_html;
}
add_filter('bcn_allowed_html', 'my_bcn_allowed_html');

To get started quickly, just copy and paste the above code into a site specific plugin and start playing.

-John Havlik

[end of transmission, stay tuned]

vBulletin Style Breadcrumbs for WordPress

vBulletin is a somewhat popular forum software package that has a unique breadcrumb design. Rather than the normal, single lined breadcrumb trail, it drops the current item’s breadcrumb to a second line. It also happen to have two folder icons for flair, but those are trivial to add in with CSS3. Even without CSS3 adding the icons is fairly easy (set as a non-repeating background image).

Continue reading

Breadcrumb NavXT Multi Dimension Extensions 1.6.0

Previously, in the Vista-Like Breadcrumbs for WordPress guide, code was presented for recreating the breadcrumb style featured in Windows Vista and Windows 7. That code eventually was updated and placed into a plugin to ease implementation. In Breadcrumb NavXT 4.2 some internal changes were made that caused issues with the previous version of this plugin. Now, Breadcrumb NavXT Multi Dimension Extensions have been updated to work with Breadcrumb NavXT 4.2 and the forthcoming version 4.3 release.

Eventually, this and the rest of the Breadcrumb NavXT extensions plugins will make it into the official WordPress.org plugin repository so everyone will get update notifications. Until then, you’ll have to manually update (by first deleting and then re-installing).

Installation is quite easy:

  1. Download the Master branch zip archive from GitHub
  2. In your WordPress Dashboard navigate to the plugin uploader (Plugins > Add New > Upload)
  3. Upload the zip archive
  4. Activate and enjoy!

You can keep up with day to day development via the Breadcrumb NavXT Extensions’ GitHub Repository.

-John Havlik

[end of transmission, stay tuned]

Post Parents 0.2.0

Normally, flat post types such as the Post post type do not have parents. However, some like to use pages for their hierarchy and want posts to be children of these pages. While I do not recommend this type of site structure, Breadcrumb NavXT has supported Pages as the parent of Posts for quite some time. In a recent version this was extended to all post types, using the “post parent” selection for the post hierarchy.

The caveat has always been that setting the parent of the post was an exercise left to the user. Last summer, I wrote a fairly basic plugin that makes things easier. Previously meant only for the Post post type, this new version extends post parents to all post types (except for Pages as that wouldn’t make sense). It simply adds a Parent metabox with a pages drop down to the edit screen for posts (of any post type).

Eventually, this will make it into the official WordPress.org plugin repository so everyone will get update notifications. Until then, you’ll have to manually update (by first deleting and then re-installing).

Installation is quite easy:

  1. Download the Master branch zip archive from GitHub
  2. In your WordPress Dashboard navigate to the plugin uploader (Plugins > Add New > Upload)
  3. Upload the zip archive
  4. Activate and enjoy!

You can keep up with day to day development via the Post Parents’ GitHub Repository.

-John Havlik

[end of transmission, stay tuned]

Order Bender 0.5.0

By popular demand, Order Bender has received a substantial update. Now, rather than just working with categories, it will work with any hierarchical taxonomy on any post type (that is uses the taxonomy). Thus, now it is possible to specify a preferred custom taxonomy term for any post type for Breadcrumb NavXT.

Eventually, this will make it into the official WordPress.org plugin repository so everyone will get update notifications. Until then, you’ll have to manually update (by first deleting and then re-installing).

Installation is quite easy:

  1. Download the Master branch zip archive from GitHub
  2. In your WordPress Dashboard navigate to the plugin uploader (Plugins > Add New > Upload)
  3. Upload the zip archive
  4. 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]