4.6.x theme.inc theme_breadcrumb($breadcrumb)
4.7.x theme.inc theme_breadcrumb($breadcrumb)
5.x theme.inc theme_breadcrumb($breadcrumb)
6.x theme.inc theme_breadcrumb($breadcrumb)
7.x theme.inc theme_breadcrumb($variables)

Return a themed breadcrumb trail.


$breadcrumb: An array containing the breadcrumb links.

Return value

a string containing the breadcrumb output.

Related topics

2 theme calls to theme_breadcrumb()
chameleon_page in themes/chameleon/chameleon.theme
template_preprocess_page in includes/theme.inc
Process variables for page.tpl.php


includes/theme.inc, line 1301
The theme system, which controls the output of Drupal.


function theme_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';


Danny_Joris’s picture

I had to replace the separator (angle quotation mark) with it's html-entity to make it work. So &raquo; becomes » .

mikl’s picture

If » does not work on your site without having to use HTML entities, it would seem that your site has encoding issues. Drupal sites should always use UTF-8…

FatGuyLaughing’s picture

I have found this post that uses this function to create breadcrumbs based off the URL.
Don't know who to give credit to, but thanks!


stuarteske’s picture

Here is a little snippet to make separator images


function phptemplate_breadcrumb($breadcrumb) {
	   if (!empty($breadcrumb)) {
		   $separator_icon = '<div class="breadcrumb-separator">&nbsp;&nbsp;&nbsp;&nbsp;</div>';
		   $breadcrumb_string = '<div class="breadcrumb">'
			   . implode($separator_icon, $breadcrumb)
			   . '</div>';
		   return $breadcrumb_string;


div.breadcrumb-separator {
	display: inline;
	background: url(breadcrumb-separator.png) no-repeat bottom left;
heather’s picture

If you base your theme function off the sample function theme_breadcrumb($breadcrumb) above in a fresh theme you end up with nested divs, with a class and ID of the same name.
You get this:

<div id="breadcrumb">
<div class="breadcrumb">
<a href="/">Home</a> » <a href="/link">Link 2</a>

Instead use:

function themename_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    return implode(' » ', $breadcrumb);

And avoid the 2nd div.