incorrect breadcrumb sequence – not resolved

#274082
  • Resolved Steven
    Rank Math business

    Hi, I still have a problem with the breadcrumbs – i have followed all the steps and added the code as per the previous ticked but when in a Portfolio Category the breadcrumb doesn’t show “Portfolio” in the sequence – therefore it’s not possible to view a portfolio category and then click the link for “Portfolio” in the breadcrumb and return to the Portfolio main page which obviously shows all the categories.

    How do I replace “portfolio category” in the breadcrumb with “portfolio” as an active link when viewing a portfolio category?

    See the attached screenshots:

    How the breadcrumb appears when in a Portfolio Category – NOTE that “Portfolio” link is missing, instead it shows “Portfolio Category” which I do not want: https://snipboard.io/T1gQ3t.jpg

    How the breadcrumb appears when viewing a portfolio item (which is correctly showing “Portfolio” in the breadcrumb sequence):
    https://snipboard.io/gU7Mxd.jpg

    I want “Portfolio” to appear in place of “Portfolio Category” when viewing a Portfolio Category such as https://baxalldev.adamsnewmedia.co.uk/portfolio-category/heritage/

    Please explain how to do this. Thanks!

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

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    We created a custom code snippet that you can modify further per your requirements to add the links to the portfolio category in the breadcrumbs when viewing pages from that taxonomy.

    
    // Add link to breadcrumbs
    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {
    	if(is_tax('portfolio-category')) {
    		$crumbs[1][0] = 'Portfolio';
    		$crumbs[1][1] = 'https://baxalldev.adamsnewmedia.co.uk/portfolio';
    	}
    	return $crumbs;
    }, 10, 2);
    

    ​​​​​​​If you need this sort of functionality to be different or to apply to different pages you can modify this filter directly from your functions.php file.

    Don’t hesitate to get in touch if you have any other questions.

    Steven
    Rank Math business

    Thank you Miguel. Do I add this filter snippet to functions.php?

    Steven
    Rank Math business

    Brilliant Miguel, thank you for this!

    Anas
    Rank Math business

    Hello,

    Yes, you should add the filter in the theme’s functions.php file.

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    I hope this helps. Don’t hesitate to get in touch if you have any other questions.

    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 4 replies - 1 through 4 (of 4 total)

The ticket ‘incorrect breadcrumb sequence – not resolved’ is closed to new replies.