WordPress — Breadcrumb NavXT проблема с категориями

У меня есть некоторые серьезные проблемы с этим плагином

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

У меня есть этот макет на моем сайте. В моем файле functions.php я создал несколько новых категорий внутри «Продукты», используя следующий код:

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,
)
);
}

Что создает следующее:

введите описание изображения здесь

Отсюда я добавил подкатегории к каждому из них, например:

введите описание изображения здесь

И затем, когда я создаю продукты, я просто выбираю, к какой подкатегории они относятся.

Теперь — моя проблема. Когда я нажимаю на мою страницу безопасности, плагин работает нормально, он выглядит так:

Мой сайт> Безопасность

Но потом, если я нажму на подкатегорию из категории «Безопасность», такую ​​как категория «Безопасность», вместо крошки перейдем к

Мой сайт> Безопасность> Категория безопасности

Это идет к

Мой сайт> Безопасность

У кого-нибудь есть какие-либо идеи?

В плагине, в настройках есть опция для таксономии, которая показывает это:

<span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="Go to the %title% Safety archives." href="%link%">%htitle%</a></span>

12

Решение

Управляйте тем, что произошло в Breadcrumb-NavXT / class.bcn_breadcrumb_trail.php в строке функции fill () 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);
}
1

Другие решения

Следуй этим шагам

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

надеюсь, это поможет

1

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector