WordPress.org

Ready to get started?Download WordPress

Forums

Breadcrumb NavXT
Is it possible to exclude the parent category from the breadcrumb? (2 posts)

  1. pantone
    Member
    Posted 1 year ago #

    Let's say I have a food blog and there is a category called "Desserts". This "Desserts" category is a parent category and under this parent category are subcategories like "Ice Cream", "Cakes", and "Cupcakes".

    If I am on a blog post where the category for the post is "Ice Cream", the breadcrumb, by default, would appear like this:

    Homepage > Desserts > Ice Cream > Current Blog Post Title

    Is it possible to exclude the parent category "Desserts" so that the breadcrumb appears like this:

    Homepage > Ice Cream > Current Blog Post Title

    Thank you.

    http://wordpress.org/plugins/breadcrumb-navxt/

  2. John Havlik
    Member
    Plugin Author

    Posted 1 year ago #

    Well, fundamentally, you should be asking yourself why you want to have a hidden category (that's essentially what you are doing with the category Desserts). If you really mean that "Current Blog Post Title" is really a Dessert post type, you should consider using a Custom Post Type.

    Breadcrumb trails should not excluded breadcrumbs from the trail, it is a bad practice, just as having hidden categories is a bad practice. If you really want to do this, it is possible, you'll need to hook into the 'bcn_after_fill' action and remove the breadcrumb from the trail member of the bcn_breadcrumb_trail object that is passed into your hook handler.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic