How to add Schema markup to breadcrumbs
How to add Schema markup to breadcrumbs
How to add Schema markup to breadcrumbs
I am supprised that this question still accepts answers once woocommerce is a plugin and out of the scope of this chat. Anyhow for what I have understood you want to show the product title on the woocommerce breadcrumb, Woocommerce breadcrumb already does that by default, there is no need of any changes, just remove … Read more
Link custom post type to parent page and show in slug / breadcrumb
Multiple categories assigned to a single product breaking the breadcrumb
Try to change this part: echo $before . ‘Search results for “‘ . get_search_query() . ‘”‘ . $after; To this: $searchTerm = get_search_query() echo $before . ‘Search results for “‘ . $searchTerm . ‘”‘ . $after;
For question 1, use a custom field when you create the page and use the same template each time. Here is an example using a custom field named house_type. <?php // Template Name: House Type [ … ] $house_type = get_post_meta( get_queried_object_id(), ‘house_type’, true ); $args = array ( ‘post_type’ => ‘house’, ‘orderby’ => ‘meta_value’, … Read more
That plugin represents a fair bit of code to read through but I did not see any obvious way to prioritize/eliminate/ignore categories in the way you want. I would suggest that you stop abusing categories and convert your code to use post meta (probably) instead of categories to ” to assign specific properties to given … Read more
I’m not sure if you want it like this, however, this can be achieved by CSS. .crumbs > span > span + span { margin-left: 1em; } .crumbs > span > span + span:before { content: ‘|’; /* or something else */ *display: inline; display: inline-block; margin-left: -1em; width: 1em; text-align: center; } // EDIT … Read more
Your custom post type matches the conditional is_single(), so this part is trying to output the category the post is assigned to, which I’m assuming doesn’t exist: if (is_category() || is_single()) { $category = get_the_category(); $crumbs .= ‘<span typeof=”v:Breadcrumb”><a rel=”v:url” property=”v:title” href=”‘.get_category_link($category[0]->cat_ID).'”>’.$category[0]->cat_name.'</a></span>’; } either check if $category contains a category, or change is_single to just … Read more
Doing same thing in more concise way: function breadcrump_page( $post ) { $format=”<a href=”https://wordpress.stackexchange.com/questions/140362/%s” title=”https://wordpress.stackexchange.com/questions/140362/%s”>%s</a> >”; $anc = array_map( ‘get_post’, array_reverse( (array) get_post_ancestors( $post ) ) ); $links = array_map( ‘get_permalink’, $anc ); foreach ( $anc as $i => $apost ) { $title = apply_filters( ‘the_title’, $apost->post_title ); printf( $format, $links[$i], esc_attr($title), esc_html($title) ); } … Read more