Modify Breadcrumbs Just Only for Single Post

#215084
  • Resolved Paolo
    Rank Math free

    Hi there

    I like to use the following snippet

    add_filter( 'rank_math/frontend/breadcrumb/settings', function( $settings ) {
    $settings = array(
    'home' => true,
    'separator' => '/',
    'remove_title' => true,
    'hide_tax_name' => '',
    'show_ancestors' => '',
    );
    return $settings;
    });

    Just only for single blog post

    Any hint about that?

    Thanks in advance

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention.

    You can use the if(is_singular('post') line to target all your posts only.

    It should be something like this:

    add_filter( 'rank_math/frontend/breadcrumb/settings', function( $settings ) {
    if(is_singular('post')){
    $settings = array(
    'home' => true,
    'separator' => '/',
    'remove_title' => true,
    'hide_tax_name' => '',
    'show_ancestors' => '',
    );}
    return $settings;
    });

    Please try this filter and let us know if it works on your site.

    Looking forward to helping you.

    Thank you.

    Paolo
    Rank Math free

    Hi Reinelle

    works like a charm

    Thanks for the quick response and fort the support

    Regards

    Paolo
    Rank Math free

    Hi Reinelle

    what about if i like to apply the same filter to Woocommerce single product?

    Best and thanks in advance for the response

    Paolo
    Rank Math free

    Solved 😉

    Ankit
    Rank Math business

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘Modify Breadcrumbs Just Only for Single Post’ is closed to new replies.