Hi, I wonder if you can help me expand on this code that I found in your forums. https://theme.co/apex/forum/t/breadcrumbs-with-custom-blog-page/47130/4
It alters the breadcrumbs on single post pages so the Blog URL is set to a custom page. This is great but can this be applied also to post category archives but not product category archives?
add_filter('x_breadcrumbs_data', 'post_parent_trail', 9999999, 2);
function post_parent_trail ($crumbs, $args) {
if ( is_singular('post') ) {
$post_ID = 3433;
$post_array = array();
$post_array[1]['label'] = get_the_title( $post_ID );
$post_array[1]['url'] = get_permalink( $post_ID );
array_splice($crumbs, 2, 0, $post_array);
unset($crumbs[1]);
}
return $crumbs;
}
Thanks