Tagged: breadcrumbs
Hello,
The Categories are not showing up in the Breadcrumbs. Is there a setting for it? I do not find any.
Best regards
Andre
Hey TT2495,
Thank you for the inquiry.
The first category should display in the breadcrumb, but not all. Are you trying to display all categories in the breadcrumb? Adding this filter in the functions.php file might help.
// breadcrumbs filter for blog posts, stop breadcrumbs showing category for news
if(!function_exists('avia_modify_single_post_breadcrumb'))
{
function avia_modify_single_post_breadcrumb($trail)
{
if(!is_single()) return $trail;
$category = get_the_category(get_the_ID());
if(empty($category)) return $trail;
$newtrail = array();
foreach($category as $cat)
{
if(empty($cat->parent))
{
$category_link = get_category_link($cat->term_id);
$newtrail[] = '<a href="'.esc_url( $category_link ).'" title="'.$cat->cat_name.'">'.$cat->cat_name.'</a>';
}
}
if(empty($newtrail)) return $trail;
array_unshift($newtrail, $trail[0]);
$newtrail['trail_end'] = $trail['trail_end'];
return $newtrail;
}
add_filter('avia_breadcrumbs_trail','avia_modify_single_post_breadcrumb');
}
Best regards,
Ismael