Anonymous
August 15, 2019 at 2:17 pm
Hi
I am using yoast breadcrumbs and have added the following to my functions.php in my child theme:
add_action('kt_afterheader', 'custom_breadcrumbs_add');
function custom_breadcrumbs_add(){
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<div class="container"><p id="breadcrumbs">','</p></div>');
}
}
But that only seems to affects products.
To get the breadcrumbs working on my pages, I have added the following to page.php
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( '<p id="breadcrumbs">','</p>' );
}
?>
And I cannot get it to work on blog posts at all.
Question – is there code I can add to functions.php that will show breadcrumbs on products, posts AND pages? Or is adding it in separate places the right way to go?
If so, can you advise which file I need to add code to in order for breadcrumbs to show up on my posts?
Finally, to style them, do I just need to add the following to my css (or is it a different class)?
.breadcrumbs {
<style>
}
Many thanks
Dom