breadcrumbs & rel=”nofollow”

I think it depends what your goal is and what the breadcrumbs represent. I would say that for most wordpress sites nofollow on breadcrumbs is probably a nonissue. Let’s start with nofollow. Nofollow says you don’t want a search engine to pass on page rank to this link. So if you had comment links and … Read more

How to output hierarchical taxonomy path, with only the deepest term assigned?

Use get_the_terms to fetch the post’s term, then use get_ancestors to get an array of that term’s parent IDs. $tax = ‘category’; $terms = get_the_terms( get_the_ID(), $tax ); if( $terms && ! is_wp_error( $terms ) ){ // check for and output any ancestors $ancestors = array_reverse(get_ancestors( $terms[0]->term_id, $tax )); if( $ancestors ){ foreach( $ancestors as … Read more

How-to get the get_category_parents() breadcrumbs trail without link on last item

I wouldn’t consider this any better/worse than Kaiser’s option, but just different. Why not use get_category_parents on the parent category and then (optionally) append the current category? I haven’t tested this, but something like the following should work: $cat_id=7;//current category’s ID (e.g. 7) $separator=”»”;//The separator to use $category = get_category($cat_id);//$category is the current category object … Read more

Get the posttype of a taxonomy/term

On StackOverflow user indextwo suggests to do the following: Use the get_taxonomy( $taxonomy-slug ) function which returns an object that contains all the associated post types. As suggested in the comments, we can then use get_post_type_object( $post-type-slug ) to get the object and Singular Label. $post_type_names = array(); // Array( ‘post-type-slug’ => ‘Post Type Label’ … Read more

Yoast SEO breadcrumbs: how to create a filter that uses the url slug for breadcrumb titles

Yoast does have a filter for you to use. See here: https://gist.github.com/jmcclellan/b2d97ffee0e924e28fa1 I used this to add “parent” pages to custom post types. We wanted to use pages as our category landers w/ custom post types as children. Yoast would not output the parent page slug by default since there is technically no real relationship, … Read more