13

I am having some major issues with this plugin

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

I have this layout to my site. In my functions.php file, I have created some new categories inside 'Products' using the following code:

add_action( 'init', 'create_product_cat_scaffolding' );

function create_product_cat_scaffolding() {
    register_taxonomy(
        'ScaffoldingProducts',
        'products',
        array(
            'label' => __( 'Scaffolding Products' ),
            'rewrite' => array( 'slug' => 'scaffoldingproducts' ),
            'hierarchical' => true,
            )
        );
}
add_action( 'init', 'create_product_cat_fencing' );

function create_product_cat_fencing() {
    register_taxonomy(
        'FencingHoardings',
        'products',
        array(
            'label' => __( 'Fencing Hoardings' ),
            'rewrite' => array( 'slug' => 'fencinghoardings' ),
            'hierarchical' => true,
            )
        );
}
add_action( 'init', 'create_product_cat_groundworks' );

function create_product_cat_groundworks() {
    register_taxonomy(
        'Groundworks',
        'products',
        array(
            'label' => __( 'Groundworks' ),
            'rewrite' => array( 'slug' => 'groundworks' ),
            'hierarchical' => true,
            )
        );
}
add_action( 'init', 'create_product_cat_Safety' );

function create_product_cat_Safety() {
    register_taxonomy(
        'Safety',
        'products',
        array(
            'label' => __( 'Safety' ),
            'rewrite' => array( 'slug' => 'safety' ),
            'hierarchical' => true,
            )
        );
}
add_action( 'init', 'create_product_cat_access' );

function create_product_cat_access() {
    register_taxonomy(
        'Access',
        'products',
        array(
            'label' => __( 'Access' ),
            'rewrite' => array( 'slug' => 'access' ),
            'hierarchical' => true,
            )
        );
}

Which creates the following:

enter image description here

From here, I have added sub categories to each of these, for example:

enter image description here

And then when I create products, I just select which sub category they apply to.

Now - my issue. When I click onto my Safety page, the plugin works fine, it goes:

My Site > Safety

But then If I click onto a sub category from Safety, such as Safety category, instead of the breadcrumb going to:

My Site > Safety > Safety Category

It goes to

My Site > Safety

Does anyone have any ideas?

In the plugin, the settings there is an option for Taxonomies, which shows this:

<span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="Go to the %title% Safety archives." href="%link%">%htitle%</a></span>
halfer
  • 19,824
  • 17
  • 99
  • 186
  • OR and alternative which would suit my needs would be appreciated! –  Aug 20 '15 at 10:07
  • Breadcrumbs in Yoast SEO perhaps? http://kb.yoast.com/article/245-implement-wordpress-seo-breadcrumbs – Axel Aug 21 '15 at 18:49
  • Have you create custom category page in theme ? like. `taxonomy-ScaffoldingProducts.php`, `taxonomy-Safety.php`, `taxonomy-FencingHoardings.php` , `taxonomy-Groundworks.php`, `taxonomy-Access.php`, `ScaffoldingProducts.php`, `Safety.php`, `FencingHoardings.php`, `Groundworks.php` and `Access.php` all – Dr.Tricker Aug 23 '15 at 05:01
  • Hi Hemal, I have them category pages :) –  Aug 24 '15 at 07:50
  • Anyone? This has had more than 100 views –  Aug 27 '15 at 08:11
  • Still nothing - Can't even add more bounty to this? –  Sep 01 '15 at 08:00
  • Do I start a new question? My bounty has gone but still no answer –  Sep 04 '15 at 08:10

2 Answers2

2

Follow these steps

 go to Setting > Permalinks > Select Custom Structure
 add this into textbox /%category%/postname

hope this will help

Ghulam Ali
  • 357
  • 4
  • 17
1

Control what's happened in Breadcrumb-NavXT/class.bcn_breadcrumb_trail.php at fill() function line 855.

else if(is_archive())
{
    $type = $wp_query->get_queried_object();
    //For date based archives
    if(is_date())
    {
        $this->do_archive_by_date();
    }
    else if(is_post_type_archive() && !isset($type->taxonomy))
    {
        $this->do_archive_by_post_type();
    }
    //For taxonomy based archives
    else if(is_category() || is_tag() || is_tax())
    {
        $this->do_archive_by_term();
    }
    $this->type_archive($type);
}
Garry Cooper
  • 206
  • 1
  • 5
  • So like this? if(count($this->breadcrumbs) > 0) { //Exit early since we have breadcrumbs in the trail return NULL; } else if(is_archive()) { $type = $wp_query->get_queried_object(); //For date based archives if(is_date()) { $this->do_archive_by_date(); } else if(is_post_type_archive() && !isset($type->taxonomy)) { $this->do_archive_by_post_type(); } //For taxonomy based archives else if(is_category() || is_tag() || is_tax()) { $this->do_archive_by_term(); } $this->type_archive($type); } –  Aug 25 '15 at 08:27
  • If I am at home - Category, and click a sub category, IT then goes Home - Sub Category - Sub Category –  Aug 25 '15 at 08:28