Added code to delete the word HOME from breadcrumb but doesn’t work

#999669
  • Hello

    I am using elementor and rank math. I am trying to NOT show the word HOME on home page when using breadcrumbs. I want the word HOME to show on other pages but NOT on the HOME page. I used the chat and it gave me a few code options to add but nothing us working. I also tried to add code to my functions file on the theme but the word home does not go away. I don’t know what else to do.

    PS: I used the shordcode to show breadcrumbs on my site.

Viewing 1 replies (of 1 total)
  • Hello,

    I apologize for the issue you are facing with the breadcrumbs on your homepage. To remove the word "HOME" from the breadcrumbs specifically on the homepage while keeping it on other pages, you can try modifying the code in your theme’s functions.php file. Here’s a sample code snippet that you can use:

    add_filter('rank_math/breadcrumbs', function($crumbs) {
        if (is_front_page()) {
            // Remove the first breadcrumb item (Home)
            array_shift($crumbs);
        }
        return $crumbs;
    });

    This code checks if the current page is the homepage and removes the first item from the breadcrumbs array, which is typically the "Home" link.

    Make sure to add this code to your theme’s functions.php file and clear any caching plugins you might be using to see the changes.

    If this does not resolve the issue, please reply to this ticket with your site URL so we can further assist you. Thank you for raising this concern, and we’re here to help!

    Sources:
    How to Make Your Theme Rank Math Compatible » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.