-
AuthorPosts
-
December 12, 2024 at 12:19 am #1473456
Hello!
When the post has more that one category selected, there is a combobox below to choose “main category”, which does nothing but helping to use right breadcrumbs. But in my case choosing another main category does not change breadcrumbs. Is it possible to select category to get breadcrumb I need?December 12, 2024 at 6:06 am #1473466Hey ibuzaev,
Thank you for the inquiry.
Where can we check the issue? Please provide the site URL in the private field and post a screenshot using platforms like Savvyify, Imgur or Dropbox.
Best regards,
IsmaelDecember 13, 2024 at 5:12 pm #1473591Thank you, Ismael.
Page example is https://buzaevclinic.ru/clinical-video-case-quick-tremor-rigidity-relief-parkinson-focused-ultrasound/Here is the diagram explaining this problem:
https://disk.yandex.ru/i/ca4BK1mDrP3rxADecember 16, 2024 at 5:45 am #1473725Hi,
Thank you for the update.
The sidebar and widgets are missing on the page you posted above. Also, the breadcrumb is not updating because there is no script present that connects the category selection with the breadcrumb, meaning they won’t interact with each other. Unfortunately, connecting these two would require modifications that are beyond the scope of support.
Best regards,
IsmaelDecember 16, 2024 at 10:44 pm #1473791Dear Ismael,
I did not understand about sidebar and widgets, did I something wrong with that script? Does sidebar and widgets presence solve that problem?December 16, 2024 at 10:48 pm #1473792The sidebar I send in the screenshot is standard sidebar of wordpress edit. If there is more than one category selected additional combobox appears to select “main category” which usually is used I suppose to permalink category and breadcrumbs.
December 17, 2024 at 5:46 am #1473807Hi,
Sorry for the misunderstanding. I thought there was a sidebar widget that allows you to filter categories. If you need to include the parent category in the breadcrumb trail, please try adding this filter to the functions.php file:
function avia_breadcrumbs_trail_mod($trail) { if (get_post_type() === 'post' && is_single()) { $categories = get_the_category(); if (!empty($categories)) { usort($categories, function($a, $b) { return $a->parent - $b->parent; }); $parent_category = $categories[0]; $category_link = '<a href="' . get_category_link($parent_category->term_id) . '" title="' . esc_attr($parent_category->name) . '">' . esc_html($parent_category->name) . '</a>'; $newtrail = array(); $newtrail[0] = $trail[0]; $newtrail[1] = $trail[1]; $newtrail[2] = $category_link; // Parent category link $newtrail[3] = $trail[2]; // Child category link $newtrail['trail_end'] = $trail['trail_end']; $trail = $newtrail; } } return $trail; } add_filter('avia_breadcrumbs_trail','avia_breadcrumbs_trail_mod');
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.