• Resolved rjpedrosa

    (@rjpedrosa)


    Hi,

    I have a custom post type called “Regional Hubs”.
    Using this plugin, I’ve set it as a child of page “Locations”.

    Right now the breadcrumb shows as, e.g. for the Europe hub, “Home > Locations > Europe”.
    I want it to be “Home > Locations > Regional Hubs > Europe”.
    I know I can have it like that if the custom post type has archive enabled and I set the . But I don’t want to have an archive for that custom post type. I don’t want the “Regional Hubs” part of the trail to be clickable.

    Any help? Thanks!

    https://ww.wp.xz.cn/plugins/breadcrumb-navxt/

Viewing 1 replies (of 1 total)
  • Plugin Author John Havlik

    (@mtekk)

    To get this automatically added, you’ll need an archive for the CPT. However, you can remove the URL for that item. To do this you will want to hook into the bcn_after_fill action and do something similar to what this user did (he helpfully pulled together information I’ve posted elsewhere in his forum post): https://ww.wp.xz.cn/support/topic/how-to-remove-cpt-archive-itemlink-from-trail?replies=3#post-7508284

    The other way is to manually add an unlinked breadcrumb into the proper spot. Again, this is done in a hook to the bcn_after_fill action. You will need to check that the breadcrumb trail needs the added breadcrumb, and then splice your unlinked instance of bcn_breadcrumb into the bcn_breadcrumb_trail::breadcrumbs array of bcn_breadcrumb objects at the desired spot.

Viewing 1 replies (of 1 total)

The topic ‘Include custom post type name with no archive’ is closed to new replies.