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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)