A guide to Breadcrumbs Plugin

Breadcrumbs Plugin is a plugin that displays a breadcrumb menu on your site.

How to install the plugin

  1. Uzip the rdfa-breadcrumbs.zip folder.
  2. Upload the rdfa-breadcrumbs folder to your /wp-content/plugins directory.
  3. In your WordPress dashboard, head over to the Plugins section.
  4. Activate RDFa Breadcrumbs.

How to use the plugin

This plugin work automatically with Genesis, Hybrid, Nifty, Thematic and Thesis. In other theme won't work automatically. So, you'll have to add it manually in your template files. Where? Well, that's really up to you. You can add it anywhere you want.

This is the basic code:

 

The default parameters

By default, this plugin is designed to show things a certain way. Here are the defaults:

$defaults = array(
	'prefix' => '<p>',
	'suffix' => '</p>',
	'title' => __( 'You are here: ', 'rdfa_breadcrumbs' ),
	'home' => __( 'Home', 'rdfa_breadcrumbs' ),
	'sep' => '»',
	'front_page' => false,
	'bold' => true,
	'show_blog' => true,
	'echo' => true,
	'singular_post_taxonomy' => 'category',
);
prefix
What should be shown before the breadcrumb
suffix
What should be shown after the breadcrumb
title
What should be shown before home link.
sep
The element that separates each item in the breadcrumb menu
home
The text for the home link. Set to false if no home link is needed
echo
Whether to print on the screen or return for use in a function
singular_{$post_type}_taxonomy
A taxonomy to use on singular views of specific post types
E.g. 'singular_post_taxonomy' => 'category'

Custom examples

How about we change the separator between each item?

<?php rdfa_breadcrumbs( array( 'sep' => '&rarr;' ) ); ?>

This time, we'll wrap the entire menu in brackets.

<?php rdfa_breadcrumbs( array( 'prefix' => '{', 'suffix' => '}' ) ); ?>

Now, let's add categories for singular posts.

<?php rdfa_breadcrumbs( array( 'singular_post_taxonomy' => 'category' ) ); ?>

Protect yourself from errors in the future

Sometimes, we stop using plugins, but we forget to remove the function calls to the plugins in our theme files. When deactivated, this causes errors. To protect yourself from these errors, you can call the RDFa breadcrumbs like this:

Basically, this just checks to see if the plugin is activated and has loaded the appropriate function.

Styling your rdfa breadcrumbs

RDFa Breadcrumbs comes with some extra classes to work with, so you can have a bit of freedom when styling your menu. Here are the CSS classes for your use:

.breadcrumb {
}

.rdfa-breadcrumbs {
}

.breadcrumbs-separator {
}

Copyright & license

RDFa Breadcrumbs is licensed under the GNU General Public License, version 2 (GPL).

2011 – 2012 © Digital Fair. All rights reserved.