Current page at breadcrumbs

Hi,

Is it possible to hide the current page at the end of the breadcrumbs?

Thank you

Does anyone know this?

Hey @jcsneves,

can you maybe share a URL to a page you’re using the breadcrumbs on?

Best,

André

Hi André, thanks for your reply.

Here’s an example: Chegou a nova série de Certificados de Aforro (Série F). O que muda? - Investir.pt

I want to hide the post title part on the breadcrumb and the previous separator (obviously I can do that with css but Is is the best solution)?

Hey @jcsneves,

you can use the bricks/breadcrumbs/items hook to drop the last breadcrumb item:

add_filter( 'bricks/breadcrumbs/items', function( $breadcrumb_items ) {
	array_pop( $breadcrumb_items );
	return $breadcrumb_items;
} );

Let me know if that helps.

Best,

André

6 Likes

Fantastic, thanks a lot André!!

Any chance this will become a toggle switch in the element rather than needing a code snippet for this?

Hey Dustin,

feel free to create in idea for this. As always we’ll definitely consider this if there is a “global need”.

Personally I think using the hook here is perfectly fine as in most scenarios the current page is part of the breadcrumbs.

Best,

André