• Resolved leenm

    (@leenm)


    My site uses two custom post types and two custom taxonomies:
    post types: products, occasions
    taxonomies: catalog (hierarchical), brands (not hierarchical)
    Both of these taxonomies are linked to both post types.

    For the custom post types, I can set a home page which is great. For the custom taxonomies I can’t. I’ve created a custom page for taxonomy brands (taxonomy-brands.php). The breadcrumb on this page is then [Home]>[Home page set for products]>[brand]. The middle one is not right, I want to set a different page for that (the brands overview page).

    What do I do?

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

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

    (@mtekk)

    Breadcrumb NavXT attempts to pick a “root page” for custom taxonomies according to the first post type it finds associated with the taxonomy (at least that is the intent). This isn’t entirely reliable when the taxonomy is valid for multiple post types. I’m thinking of changing the behavior to have no root page if the taxonomy is valid for multiple post types.

    Under the current layout model, only the post type has root page, and this will likely be the case until. This is due to the fact that the built-in taxonomies (category and tag) are associated with the post type “post” and follow it’s root page (“page for posts”). As WordPress doesn’t fully extend this model for CPTs and Custom Taxonomies, Breadcrumb NavXT attempts to follow the existing model faithfully, providing the root page for post types as fill in for what WordPress has for regular posts but not CPTs. This model is unlikely to change until taxonomies and post types are merged (there have been mumblings on this, but I don’t think it has gained traction yet).

    In the mean time, you can either extend the plugin (there are actions and hooks available to aid in this) to give yourself the desired trail. Or, you can look at using the Breadcrumb NavXT Menu Magic premium plugin which will allow you to define custom structures for Breadcrumb NavXT to follow using a WordPress menu (will fall back to it’s normal operation for resources not in the menu).

    Thread Starter leenm

    (@leenm)

    Thnx, I’ll have a look at the magic menu plugin.

    For now I’ve solved the problem by using the bcn_after_fill hook:

    add_action( ‘bcn_after_fill’, ‘bcn_customize_breadcrumb’ );

    function bcn_customize_breadcrumb($trail) {
    global $wp_query;
    if( $wp_query->queried_object->taxonomy == ‘vg_brands’ ) {
    $trail->trail[1]->set_title(‘Brands’);
    $trail->trail[1]-`set_url(get_permalink(get_page_by_path(‘brands’)));
    }
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set/show home page for taxonomy’ is closed to new replies.