My Divi Breadcrumbs Module allows you to display breadcrumbs links on your Divi site. The breadcrumbs for a post or archive page by default include a link to the homepage. If you have configured a separate static "Posts Page" (in "Settings > Reading") and would like to include a link to it in your breadcrumbs too, you can do so using the following PHP:
add_filter('et_pb_dmb_breadcrumbs_crumbs', 'dbc_show_blog_page_link');
if (!function_exists('dbc_show_blog_page_link')) {
function dbc_show_blog_page_link($crumbs) {
if ((is_array($crumbs)) &&
(is_single() || is_archive()) &&
(get_option('show_on_front') === 'page')) {
$blog_id = get_option('page_for_posts');
array_splice($crumbs, 1, 0, array(
array(
'text'=>get_the_title($blog_id),
'url'=>get_permalink($blog_id)
)
));
}
return $crumbs;
}
}
Related Post: Adding PHP to the Divi Theme
0 Comments