• Resolved snoop23

    (@snoop23)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Phi Phan

    (@mr2p)

    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.

    Thread Starter snoop23

    (@snoop23)

    Hey!

    Thanks for the quick response. Much appreciated.

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

    Keep up the great work!

    Plugin Author Phi Phan

    (@mr2p)

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘tag structure’ is closed to new replies.