Hello @invisionary,
I hope you’re doing great today.
From your screenshot I assume, that Posts is the top level category, and News is its subcategory.
If the above is correct, could you please try adding the following PHP code snippet as a must use plugin:
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$root_category_name = 'Posts';
$root_category_link = '/posts/';
add_action( 'smartcrawl_breadcrumbs_after_prepare_items', function() {
if ( ! is_singular('post') ) {
return;
}
global $root_category_name;
$categories = get_the_category();
foreach ( $categories as $category) {
$cat_id = $category->term_id;
$parent_cat_ids = get_ancestors( $cat_id, 'category');
$root_cat_id = count($parent_cat_ids) > 0 ? $parent_cat_ids[count($parent_cat_ids) - 1] : 0;
if (get_the_category_by_ID($root_cat_id) === $root_category_name ){
add_action('wp_head', 'sc_breadcrumb_css', 999 );
return;
}
}
return;
}, 999);
function sc_breadcrumb_css() {
global $root_category_link;
?>
<style>
span.smartcrawl-breadcrumb-separator:nth-child(4), .smartcrawl-breadcrumb a[href*="<?php echo $root_category_link; ?>"] {
display: none !important;
}
</style>
<?php
}
Please replace Posts with the category name, and /posts/ with its link on these lines:
$root_category_name = 'Posts';
$root_category_link = '/posts/';
Save the code as a PHP file in your text editor, for example: smartcrawl-remove-posts-category-breadcrumbs.php
Finally, upload the saved file to /wp-content/mu-plugins/ directory on the server, and check the breadcrumbs after that.
Hope this helps. Please let us know if you have further questions.
Best Regards,
Dmytro