Wordpress help with generating breadcrumbs needed

15 views
Skip to first unread message

Aharon Varady

unread,
Jan 8, 2020, 3:23:18 PM1/8/20
to Open Siddur Technical Discussion List

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.)


--
Aharon Varady
Founding Director, shamesh
the Open Siddur Project
https://opensiddur.org

Twitter | Facebook
Pronouns: He/him/his

Aharon Varady

unread,
Jan 11, 2020, 6:27:29 PM1/11/20
to Open Siddur Technical Discussion List
Thank you all and shavua tov -- figured it out by taking a closer look at the Yoast SEO plugin's breadcrumb code and making the requisite changes there.

Reply all
Reply to author
Forward
0 new messages