Hi, I am using the below code in my functions file. Problem is it has 2 links to the home page in it, so it will be like HOME >LEARN ENGLISH> SUBJECT> IDIOMS the first home is the little house icon, is it possible to remove the second link which is the ‘blog title’, not sure why it is even there. if I leave it blank then it ends up > >
add_filter('x_breadcrumbs_data', 'post_parent_trail', 9999999, 2);
function post_parent_trail ($crumbs, $args) {
if ( is_singular('post') ) {
$category = get_the_category( get_the_ID() );
if ( count( $category ) > 0 ) {
$cat_array = array();
$cat_array[1]['label'] = $category[0]->name;
$cat_array[1]['url'] = get_category_link( $category[0]->term_id );
array_splice($crumbs, 2, 0, $cat_array);
}
}
return $crumbs;
}