Breadcrumbs from menu URL I have implemented breadcrumbs in Drupal 7, using the following code in mytheme.inc file. It is working fine for all the custom pages but for a particular content type lets say CT1, I have url alias setup as homepage/page2/page3/[node:title] so the breadcrumb trail display as homepage > page2 > page3 > title of content but it is only displaying as homepage > title of content. Please advise what I am missing here to make it work the way I want. 

function mytheme_breadcrumb($variables)
{
    $breadcrumb = $variables['breadcrumb'];
    $crumbs = null;
    if (!empty($breadcrumb)) {
        $array_size = count($breadcrumb);
        $i = 0;
        while ($i &lt; $array_size) {
            $crumbs .= '&lt;li&gt;' . $breadcrumb[$i] . '&lt;/li&gt;';
            $i++;
        }
        $crumbs .= '&lt;li class="active"&gt;' . menu_get_item()['title'] . '&lt;/li&gt;';
        return $crumbs;
    } else {
        return '&lt;li class="active"&gt;Homepage&lt;/li&gt;';
    }
}
You might want to try a community solution for this like breadcrumbs by path

Your custom function isn't doing anything with the url path itself, it's just using the breadcrumb variable. You can get the path with:

$_SERVER['HTTP_HOST'] . request_uri();


Then you could split by '/' and use drupal_set_breadcrumb to set it.