Hi,
Is it possible to have a custom blog page show in the breadcrumbs ? My situation is that I have not defined a blog page within the WordPress settings, as I am using The Grid to define this with a shortcode on a custom page.
Based on this, I now have Home > Blog > Category > Post. What I am looking to do is to replace any instances of “blog” with “Articles”, so Home > Articles > Category > Post etc…
I am already using the below function, so I guess it needs some small modification
add_filter('x_breadcrumbs_data', 'post_parent_trail', 9999999, 2);
function post_parent_trail ($crumbs, $args) {
if ( array( 'post', 'product' ) ) {
$category = get_the_category( get_the_ID() );
if ( count( $category ) > 0 ) {
$cat_array = array();
$cat_array[1]['label'] = $category[0]->name;
$cat_array[1]['url'] = get_category_link( $category[0]->term_id );
array_splice($crumbs, 2, 0, $cat_array);
}
}
return $crumbs;
}
Thanks