Can anyone help me with code for presenting breadcrumbs on
opensiddur.org? Feel free to reply privately if you wish.
Basically what I want for every post is as follows:
1) a breadcrumb to the post's immediate parent category,
2) with only that final parent category linked in the breadcrumb
3) and the title of the current post left out of the breadcrumb
I've been trying to figure out how to code this myself and I've been unsuccessful at getting all three done together in one bit of code to add to our theme's functions.php. (I've been successful at getting each of the above done separately.)
I'm about to give up but didn't want to before asking the list if any of you might be able to help.
Here's the code for removing the post title. Unfortunately, it leaves everything else linked. If I could only get it to leave just the immediate parent linked, I'd be happy.
---
function remove_breadcrumb_title( $link_output) {
if(strpos( $link_output, 'breadcrumb_last' ) !== false ) {
$link_output = '';
}
return $link_output;
}
add_filter('wpseo_breadcrumb_single_link', 'remove_breadcrumb_title' );
---
(the reference to 'wpseo' is a hook to the breadcrumb generated by a plugin called Yoast SEO, which helpfully allows us to indicate a primary category for posts in multiple categories, among other things.)
--