tag structure | WordPress.org

[ad_1]

Hello @snoop23,

Thank you for your feedback. Currently, there is no easy and fast way to add prefix and suffix to the breadcrumbs. However you can customize the breadcrumbs by the the hook: breadcrumb_block_get_items . For example, if you want to display a custom label for the cat tag you could do as follows:

add_filter(
	'breadcrumb_block_get_items',
	function ( $items, $breadcrumb ) {
		// Harded-code tag_id here.
		$tag_id = 25;
		if ( is_tag( $tag_id ) ) {
			// Remove the last item.
			array_pop( $items );

			// Add custom value.
			$items[] = [ wp_strip_all_tags( sprintf( __( 'Cute “%s” pics', 'breadcrumb-block' ), single_tag_title( '', false ) ) ), get_tag_link( $tag_id ) ];
		}

		return $items;
	},
	10,
	2
);

Best regards,

Phi.

Hey!

Thanks for the quick response. Much appreciated.

I’m no coder, but will give this a shot nonetheless.

Keep up the great work!

You’re welcome! Feel free to ask if you have any questions or run into any issues.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer