Breadcrumb NavXT issue with categories
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:
From here, I have added sub categories to each of these, for example:
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>
控制fill()函数行855处的Breadcrumb-NavXT / class.bcn_breadcrumb_trail.php中发生的情况。
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);
}
Follow these steps
go to Setting > Permalinks > Select Custom Structure
add this into textbox /%category%/postname
hope this will help
链接地址: http://www.djcxy.com/p/39190.html上一篇: WordPress中的面包屑