Help in Customizing Breadcrumbs Display

#433672
  • Resolved Vardhan Rahaija
    Rank Math free

    I need help creating a custom filter code that edits the breadcrumbs based on my needs.

    I have activated Rank Math Breadcrumbs. As for my breadcrumbs, I have selected the categories as my Primary Taxonomy.

    Right Now, RankMath breadcrumb gives me.
    Home > Category > Post_Title

    I am thinking of creating a separate post where I can add all downloadable content of a post, like IMG and videos.

    So, I’m trying to get.
    Home > Category > Post_Title > Download

    Here, > Download is a separate post
    I can modify Permalink easily but not breadcrumbs

    I need to create a custom filter code that edits the breadcrumbs. But I also think a separate post should always have its breadcrumbs. Editing them will mess up the logic, and it’s impractical.

    What if I create and put the “Download” category under a Parent Category?
    Will this help based on your needs?

    And I don’t have any knowledge of PHP. Please help me

Viewing 1 replies (of 1 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with customizing your breadcrumbs.

    You can use the following filter to customize your breadcrumbs:

    /**
     * Allow changing or removing the Breadcrumb items
     *
     * @param array       $crumbs The crumbs array.
     * @param Breadcrumbs $this   Current breadcrumb object.
     */
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	return $crumbs;
    }, 10, 2);
    

    You can also check our filters and hooks API page for more breadcrumb related filters: https://rankmath.com/kb/filters-hooks-api-developer/.

    If you have already tried the filter and want further assistance, do you mind sharing the URLs of the affected pages so we can better understand the issue. Please edit the first post on this ticket and include the URLs in the designated Sensitive Data section.

    Looking forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Help in Customizing Breadcrumbs Display’ is closed to new replies.