please refer to the link in private content.
you can see the breadcrumbs is like this
You are here:Home /Blog /Resources /Polycrystalline vs Monocrystalline Solar Panel, Which one is better?
how can I change it to
You are here:Home /Polycrystalline vs Monocrystalline Solar Panel, Which one is better?
since you can see my link structure is as simple as the latter one
Hey paulchiao,
You might want to consider a plugin to be able to have more flexibility with breadcrumbs.
If you need further assistance please let us know.
Best regards,
Victoria
please advise plugin, thanks.
Hi,
Please try to add this code to your child theme functions.php to remove the “Blog” link from the breadcrumb:
add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 );
function avia_breadcrumbs_trail_mod( $trail, $args )
{
if ( is_single() )
{
unset($trail[1]);
}
return $trail;
}
If you want to remove the “resources” link too you can try this code:
add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 );
function avia_breadcrumbs_trail_mod( $trail, $args )
{
if ( is_single() )
{
unset($trail[1]);
unset($trail[2]);
}
return $trail;
}
Best regards,
Dude
Hi Dude,
thanks,
I added this code to function.php, it works.
the resources link is only a category link in the blog
what if I will add another category, such as “how-to” category
will I have to modify the code again?
since I do not want the category links to be shown in the breadcrumb.
thanks for your efforts.
Hi,
It depends on the hierarchy of the categories. I’d recommend to check the breadcrumb structure after you added the category. If it pops up in the breadcrumb simply add another line to the code:
unset($trail[3]);
Best regards,
Dude
Hi, Dude,
thank you again for your efforts.
Best regards,
Paul
Hi,
Glad we could help you :)
Best regards,
Dude