Hello Phi,
We can use breadcrumb_block_single_prepend in case we want to alter the path to add for instance the blog home. It asks for 2 params, one is the $post.
So we get Home > Blog > My post
But what about for an archive page ? For example for the Post CPT
The need is to have such a path for an archive page for posts :
> Home > Blog > My Cat
where my cat is the archive page, so we get the same path pattern accross the “blog” area.
thanks for your help
]]>My static code analysis security scanning tool flagged this block of code:
*/ public function output_structured_data() { if ( $this->structured_data ) { echo '<script type="application/ld+json">' . _wp_specialchars(
From /breadcrumb-block/includes/breadcrumbs.php
The error is:
Error( severity 5 ): All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '_wp_specialchars' (WordPress.Security.EscapeOutput.OutputNotEscaped).
Hello Phi,
What would be the best way to manage this frequent use case : the blog home is a single Page (and not the home page of the website), so we can have such a trail Home > Blog > my post
path?
with a IF test like if ( is_singular('post') {
How does the plugin manage this case ? what’s your advise ?
]]>Hi Phi,
I played with your plugin / block (thanks for having build it) and noticed the list-style is not applied in every cases, despite you styled the ol tag already
I do use TT4 theme as base, with WP6.5.2
I did not test on iOS, but would be nice to check too
What is strange is that i do not observe such a behavior on another website, that also runs TT4.
]]>Cool plugin. Thanks for making it.
Can we get an option please to change the structure of the taxonomies?
The on-page result for tags just reads “posts tagged X”, but it’d be cool if we could add a prefix and suffix (similar to the related block theme option).
Example: cute cat pics, with “cat” being the tag.
Also, “posts tagged” only applies to English speaking blogs/sites.
Thanks for looking into it.
]]>I saw where you added the filter breadcrumb_block_add_post_type_name
but I don’t know how to call it properly. I’ve have the hierarchy set properly in my has_archive, but it doesn’t seem to be calling it naturally, so I’m guessing I need to opt-in my post-types to be recognized by the Breadcrumb Block.
My post-type is ‘Talks’ which has a hierachy of speaking/calendar/ in front of the individual Talks.
Thanks!
]]>Hi, I saw your advice about changing the block markup. I don’t want to change the entire block or rebuild it entirely. I would like to either replace the default separator with a double chevron icon or add the double chevron as an option for the separator.
I was playing with block filters, but I seem to be doing something wrong. Any advice? The block is perfect except for the separator, which does not match the design of the theme I’m rebuilding.
]]>Is there a way to display URL path or page slug as breadcrumbs instead of pages’ title? like this
home/url0/url1/url2/url3/
Thanks
The plugin apparently includes block editor / admin assets in the frontend. This results in an API call to wp-json/users. If this is disabled for security and the user is not logged in, an error will ensue.
Please do not include block editor assets in frontend.
Great plugin!
]]>Just reporting this bug, I think :). I have checked the code it seems that your directly concatenating string to object class which cause fatal error on php v8.1.0
PHP Fatal error: Uncaught Error: Object of class WP_Post_Type could not be converted to string in /var/web/site/public_html/wp-content/plugins/breadcrumb-block/includes/breadcrumbs.php:345
Current Code in breadcrumb-block/includes/breadcrumbs.php:345
do_action( 'breadcrumb_block_single_' . $post_type, $post, $this );
Fixed Code in breadcrumb-block/includes/breadcrumbs.php:345
do_action( 'breadcrumb_block_single_' . $post_type->labels->name, $post, $this );
]]>
Hi,
Is it possible at the rail to exclude this text https://prnt.sc/sUbtZTbDJ9_p.
Also at the product pages like this one https://fshome-19344.ove-ams.servebolt.cloud/product/earn-uni-01/, can we use the full breadcrumb rail? instead of Home > Shop > product to use Home>Parent-Category>Sub-Category>Product ?
]]>Hi, this is a breadcrumb.
I have a question. Currently, the plugin only shows the first category of you have multiple categories on a post.
Which filter do you recommend that I use so I can show all category that’s part of a post?
Also, is there a way to rearrange the position of a post categories on the trail? For example, if a post shows categories to be first, second, can I change the trail to show second, first?
Thank you.
]]>Use two filters breadcrumb_block_home_url
, and breadcrumb_block_home_text
to change the URL and Text of the home item:
add_filter( 'breadcrumb_block_home_url', function ( $url ) {
return 'https://new-url.com';
} );
add_filter( 'breadcrumb_block_home_text', function ( $text ) {
return 'New Text';
} );
]]>
Use the filter breadcrumb_block_get_items
to add or remove some items from the breadcrumb trail:
add_filter( 'breadcrumb_block_get_items', function ( $items, $breadcrumbs_instance ) {
return $items;
}, 10, 2 );
]]>
Use the filter breadcrumb_block_get_breadcrumb_trail
to change the output markup of the breadcrumb:
add_filter( 'breadcrumb_block_get_breadcrumb_trail', function ( $markup, $args, $breadcrumbs_instance ) {
return $markup;
}, 10, 3 );
]]>
Hi this is a great plugin! On my site I have a separate page for posts and was thinking of changing this code so that the user gets to the posts page (my blog) instead the whole website:
protected function add_crumbs_front_page() {
//$this->add_item( __( 'Home', 'breadcrumb-block' ), esc_url( user_trailingslashit( home_url() ) ), [ 'rel' => 'home' ] );
$this->add_item( __( 'Home', 'breadcrumb-block' ), esc_url( user_trailingslashit( get_post_type_archive_link( 'post' ) ) ), [ 'rel' => 'home' ] );
}
It could be an option in the block settings, what do you think? Or does it make no sense? I have a similar breadcrumb on my woocommerce page where “home” points to the home of the store, not the home of the whole website.
]]>Hi there, thanks for developing this handy plugin!
The gap between crumbs doesn’t work for me. Inspecting the code reveals that the css variable for the gap seems to be the problem as it’s set like this:
–bb–crumb-gap: .4em margin-top:0;
Thanks
]]>Hi!
Do you think you can make this plugin available to be installed directly from the editor?
You can see more details here:
Block Plugin Checker]]>
Hi Phi,
thank you for the great plugin!
I would like to suggest an option to remove the current page’s title. In most cases the title is already on the page and if I use the breadcrumb block its on the page twice. Thats needless information overload/duplication for users which I would like to avoid.
Kind regards
Yannick
How to enable breadcrumbs to display parent and sub taxonomy?
Currently its only displaying the post type archive and not the taxonomies it belong.
]]>