Custom post type breadcrumbs

#241727
  • Resolved J Grobshaeusser
    Rank Math free

    Hey guys,

    thanks for your awesome plugin, but I have one issue I just can’t get resolved.
    Whenever I try breadcrumbs with a custom post type (generated by CPT UI), they look fine, but the breadcrumbs themselves point to the wrong link.

    Let’s say my custom post type is called cakes and the link structure is something like that:

    …/cakes/carrot-cakes/cake1

    but when I click the breadcrumb link to the carrot-cakes, it points to

    …/carrot-cakes

    which is wrong, obviously.

    Any suggestion on how to solve that?

    Cheers

Viewing 10 replies - 1 through 10 (of 10 total)
  • E:

    I guess this is an issue because regular posts and custom post types share the same cateogries. But is there any way to make it work regardless?

    Hello,

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

    The links in the breadcrumbs should point exactly to the URL of the category in question. In this case, do you get a 404 page when you click the breadcrumb link? What is the behavior that is happening?

    Also, please share in the sensitive data section one page that is experiencing this issue so we can also debug the situation from our end further.

    ​​​​​​​Looking forward to hearing back from you.

    Hi Miguel,

    well I exactly explained what’s happening, instead of pointing to the right cateogry of the custom post type the breadcrumb points to the “regular” category.

    What’s it that you dont understand?

    Cheers

    Hello,

    Can you please share the affected URL in the sensitive data section so we can check and assist you further?

    Looking forward to helping you.

    Thanks.

    I’m working locally so unfortunately no.

    I guess the category is retrived via get_category_link instead of get_term_link($term->slug, ‘category’)… and thus returns the wrong category link.

    You can easily reproduce this, just create a custom post type and use your breadcrumb shortcode on it and check the category it links to.

    Hello,

    I wasn’t able to replicate the issue on my end. Please make sure that you have made the subcategory as your post’s primary category to display them in the breadcrumbs. Here is a guide on how to choose a primary category: https://rankmath.com/kb/how-to-choose-a-primary-category/

    If the issue persists then please record a screencast showing your setup and replicating the issue, and share it with us so we can check and assist you further. You can use https://loom.com/ to record and share the screencast.

    Looking forward to helping you.

    Thanks.

    Added the video to the sensitive data.
    You can’t see the url structures but it stays the same as before.

    Hello,

    I am not able to access the page that you have shared. The login details aren’t working. Please check and provide the working login details so we can investigate this further.

    Looking forward to helping you.

    I don’t know why you’re not able.

    Anyways, here’s the steps to reproduce the issue:

    Create any custom post type
    Install Custom Post Type Permalinks and set permalinks to %category%/%postname%
    Set primary taxonomy for post type to category (in Rank math)

    Check your breadcrumbs. They are displayed incorreclty.

    Hello,

    We can see the issue on your website, but for us to provide a working solution we would really need to check the situation on your website and create a custom filter to correct the situation.

    Could you please double-check the login credentials and provide working ones for us to debug the situation? Please use admin access credentials so we can make the necessary changes.

    Looking forward to hearing back from 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 10 replies - 1 through 10 (of 10 total)

The ticket ‘Custom post type breadcrumbs’ is closed to new replies.