0

I would like the page title to be displayed as a part of the breadcrumb, at the end of the preceding path.

I've got the following code.

<div id="breadcrumbs"><span class="bread_crumbs"><?php print $breadcrumb; ?><?php print $title; ?></span></div>

I have checked the following option in appearance/settings: Append a separator to the end of the breadcrumb.

If the page is a top level page, the breadcrumb displays correctly; however, for any further level pages, the title doesn't display, but just the previous path.

How do I change this to get it to work?

This is what I would like to do: Adding the page title next to the breadcrumb.

I've now got the following code.

<div id="breadcrumbs"><span class="bread_crumbs"><?php print $breadcrumb . $title; ?></span></div>

The page title only displays for top level pages. If a page has parents, then the title doesn't get displayed. I've cleared the cache, but still no luck.

0

1 Answer 1

1

In template.php of your theme folder you can do this:

This is for changing the seperator or overriding the already available breadcrumb:

function mytheme_breadcrumb($variables) {
  $sep = ' &gt; ';
  if (count($variables['breadcrumb']) > 0) {
    return implode($sep, $variables['breadcrumb']) . $sep;
  }
  else {
    return t("Home");
  }
}

For adding title of page next to the breadcrumb you simply do this.

In page.tpl.php of your theme folder:

<div class="breadcrumb"><?php print $breadcrumb . $title; ?></div>

[Alternative Answer]:

If you dont want to do with custom code then you can try this module(Menu Breadcrumb) which will have option for adding page title at the end of breadcrumb.

In the configuration of this module you need to check this option for getting page title use menu the page belongs to the breadcrumb

Module Name is Menu Breadcrumb

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.