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

    (@mr2p)

    Hi @stiviniii,

    If your post type has archive, the post type name will be added as a prefix to the current post.

    If you’d like to control this behavior through code, here’s a snippet to achieve it:

    add_action(
    'breadcrumb_block_single_prepend',
    function ( $post, $breadcrumbs_instance ) {
    if ( 'your_post_type' === $post->post_type ) {
    // Add your custom item here.
    $breadcrumbs_instance->add_item( 'The title', 'the_url' );
    }
    },
    10,
    2
    );

    Best, Phi.

Viewing 1 replies (of 1 total)

The topic ‘Display Post Type Key’ is closed to new replies.