Hello there,
I followed the instructions from moderator Dude here to replace native Enfold breadcrumbs with Breadcrumbs NavXT into Enfold child theme as per this thread:
https://kriesi.at/support/topic/replace-theme-breadcrumbs/
to replace: (enfold-functions.php)
if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));
with:
if($breadcrumb) $additions .= bcn_display(true);
This replaces Enfold breadcrumbs with NavXT breadcrumbs correctly – but I need to take it a step further so the Breadcrumbs includes Schema.org markup (rich snippets).
The documentation for Breadcrumbs NavXT says the code in header.php should be:
<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">
<?php if(function_exists('bcn_display'))
{
bcn_display();
}?>
</div>
Notice the container div (breadcrumbs) contains the required attributes (type of) and (vocab).
The problem is after using Dude’s instructions these attributes are missing. Looking at the rendered breadcrumb code the breadcrumb is inside these divs:
<div class='stretch_full container_wrap alternate_color dark_bg_color empty_title title_container'><div class='container'>(breadcrumb here)</div></div>
How can I add these attributes into the Enfold child theme (<div class=’container’> ) ?
Any help would greatly be appreciated.
Thanks!
Hey Optic14,
Breadcrumb is wrapped within those divs. As for adding those attributes, try to replace:
if($breadcrumb) $additions .= bcn_display(true);
with:
if($breadcrumb) {
$additions .= '<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">';
$additions .= bcn_display(true);
$additions .= '</div>';
}
Let us know if this helps :)
Best regards,
Nikko
Hi Nikko,
Many thanks for your reply – yes this has resolved the issue.
This can be marked as Solved. :))
Hi,
Glad we could help! Thanks for using Enfold :)
Best regards,
Nikko