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

Custom Taxonomy Breadcrumb Navigation

Using your method, I’ve edited it a bit to make it more viable. Here’s the code, below I’ll explain. <ul> <li><a href=”https://wordpress.stackexchange.com/questions/149424/<?php echo home_url(); ?>/projects”>Projects</a></li> <?php $term = get_term_by(“slug”, get_query_var(“term”), get_query_var(“taxonomy”) ); $tmpTerm = $term; $tmpCrumbs = array(); while ($tmpTerm->parent > 0){ $tmpTerm = get_term($tmpTerm->parent, get_query_var(“taxonomy”)); $crumb = ‘<li><a href=”‘ . get_term_link($tmpTerm, get_query_var(‘taxonomy’)) . ‘”>’ … Read more

Breadcrumbs with custom post type without plugin

The issue with most breadcrumb functions is that it relies on the $post object on all pages. Not only is the $post global totally unreliable (see my post here), it might not even contain the data that we need, even if the $post global is not compromised The $post global on archive pages (which includes … Read more

Change posts list Breadcrumb

It seems that you have a misunderstanding about a static front page and a blogpage and the returned result from the conditional tags. Here is a short explanation STATIC FRONT PAGE The general misconception is that your static front page is your home page, which it is not. The static front page is just a … Read more

How to display parent category name and link for custom breadcrumb

You can use get_ancestors: <?php if ( $term_ids = get_ancestors( get_queried_object_id(), ‘category’, ‘taxonomy’ ) ) { $crumbs = []; foreach ( $term_ids as $term_id ) { $term = get_term( $term_id, ‘category’ ); if ( $term && ! is_wp_error( $term ) ) { $crumbs[] = sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/225528/%s”>%s</a>’, esc_url( get_term_link( $term ) ), esc_html( $term->name ) … Read more

Slugs as breadcrumbs for Pages

Ok, problem solved. I´ll add the script below. Hope it´s useful for someone. if ( is_page() ) { $post = $wp_query->get_queried_object(); if ( $post->post_parent == 0 ){ echo “<li> &raquo; “.ucwords(str_replace(“-“, ” “, $post->post_name)).”</li>”; } else { $title = the_title(”,”, FALSE); $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); array_push($ancestors, $post->ID); foreach ( $ancestors as $ancestor … Read more