Creating breadcrumbs in WordPress themes can be a pain.  With that in mind, this handy function should be exactly what you need.

function waz_breadcrumbs()

{

$delimiter = '»';

$name = 'Home'; //text for the 'Home' link

$currentBefore = '<span>';

$currentAfter = '</span>';

if ( !is_home() && !is_front_page() || is_paged() ) {

<a href="http://www.php.net/echo">echo</a> '&lt;div id="crumbs"&gt;';

<a href="http://www.php.net/global">global</a> $post;

$home = get_bloginfo('url');

<a href="http://www.php.net/echo">echo</a> '&lt;a href="' . $home . '"&gt;' . $name . '&lt;/a&gt; ' . $delimiter . ' ';

if ( is_category() ) {

<a href="http://www.php.net/global">global</a> $wp_query;

$cat_obj = $wp_query-&gt;get_queried_object();

$thisCat = $cat_obj-&gt;term_id;

$thisCat = get_category($thisCat);

$parentCat = get_category($thisCat-&gt;parent);

if ($thisCat-&gt;parent != 0) <a href="http://www.php.net/echo">echo</a>(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));

<a href="http://www.php.net/echo">echo</a> $currentBefore . '';

single_cat_title();

<a href="http://www.php.net/echo">echo</a> '' . $currentAfter;

} elseif ( is_day() ) {

<a href="http://www.php.net/echo">echo</a> '&lt;a href="' . get_year_link(get_the_time('Y')) . '"&gt;' . get_the_time('Y') . '&lt;/a&gt; ' . $delimiter . ' ';

<a href="http://www.php.net/echo">echo</a> '&lt;a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '"&gt;' . get_the_time('F') . '&lt;/a&gt; ' . $delimiter . ' ';

<a href="http://www.php.net/echo">echo</a> $currentBefore . get_the_time('d') . $currentAfter;

} elseif ( is_month() ) {

<a href="http://www.php.net/echo">echo</a> '&lt;a href="' . get_year_link(get_the_time('Y')) . '"&gt;' . get_the_time('Y') . '&lt;/a&gt; ' . $delimiter . ' ';

<a href="http://www.php.net/echo">echo</a> $currentBefore . get_the_time('F') . $currentAfter;

} elseif ( is_year() ) {

<a href="http://www.php.net/echo">echo</a> $currentBefore . get_the_time('Y') . $currentAfter;

} elseif ( is_single() ) {

$cat = get_the_category(); $cat = $cat[fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column row_column_index="0_1" type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][0];

<a href="http://www.php.net/echo">echo</a> get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');

<a href="http://www.php.net/echo">echo</a> $currentBefore;

the_title();

<a href="http://www.php.net/echo">echo</a> $currentAfter;

} elseif ( is_page() &amp;&amp; !$post-&gt;post_parent ) {

<a href="http://www.php.net/echo">echo</a> $currentBefore;

the_title();

<a href="http://www.php.net/echo">echo</a> $currentAfter;

} elseif ( is_page() &amp;&amp; $post-&gt;post_parent ) {

$parent_id  = $post-&gt;post_parent;

$breadcrumbs = <a href="http://www.php.net/array">array</a>();

while ($parent_id) {

$page = get_page($parent_id);

$breadcrumbs[] = '&lt;a href="' . get_permalink($page-&gt;ID) . '"&gt;' . get_the_title($page-&gt;ID) . '&lt;/a&gt;';

$parent_id  = $page-&gt;post_parent;

}

$breadcrumbs = <a href="http://www.php.net/array_reverse">array_reverse</a>($breadcrumbs);

foreach ($breadcrumbs as $crumb) <a href="http://www.php.net/echo">echo</a> $crumb . ' ' . $delimiter . ' ';

<a href="http://www.php.net/echo">echo</a> $currentBefore;

the_title();

<a href="http://www.php.net/echo">echo</a> $currentAfter;

} elseif ( is_search() ) {

<a href="http://www.php.net/echo">echo</a> $currentBefore . 'Search results for &amp;#39;' . get_search_query() . '&amp;#39;' . $currentAfter;

} elseif ( is_tag() ) {

<a href="http://www.php.net/echo">echo</a> $currentBefore . 'Posts tagged &amp;#39;';

single_tag_title();

<a href="http://www.php.net/echo">echo</a> '&amp;#39;' . $currentAfter;

} elseif ( is_author() ) {

<a href="http://www.php.net/global">global</a> $author;

$userdata = get_userdata($author);

<a href="http://www.php.net/echo">echo</a> $currentBefore . 'Articles posted by ' . $userdata-&gt;display_name . $currentAfter;

} elseif ( is_404() ) {

<a href="http://www.php.net/echo">echo</a> $currentBefore . 'Error 404' . $currentAfter;

}

if ( get_query_var('paged') ) {

if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) <a href="http://www.php.net/echo">echo</a> ' (';

<a href="http://www.php.net/echo">echo</a> __('Page') . ' ' . get_query_var('paged');

if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) <a href="http://www.php.net/echo">echo</a> ')';

}

<a href="http://www.php.net/echo">echo</a> '&lt;/div&gt;';

}

}
[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]