You’ll need to use something like the following for your calling code:
<?php if(function_exists('bcn_display_list')):?>
<nav class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/" aria-label="breadcrumb">
<ol class="breadcrumb">
<?php bcn_display_list();?>
</ol>
</nav>
<?php endif; ?>
Additionally, you will need something like the following in a site specific plugin:
add_filter('bcn_display_attributes', my_display_attributes_filter, 10, 3);
function my_display_attributes_filter($attribs, $types, $id)
{
$attribs .= ' class="breadcrumb-item';
//For the current item we need to add a little more info
if(is_array($types) && in_array('current-item', $types))
{
$attribs .= ' active" aria-current="page"';
}
else
{
$attribs .= '"';
}
}
Note that I have not tested the above code yet (it’s taken from an article I’m writing on this subject). In theory it should work, but there may be the minor syntax error or logic goof on my part. Also, while looking into this, I’m not exactly thrilled with the bcn_display_attributes filter and I’m looking at improving that so it (or its replacement) is easier to use for Breadcrumb NavXT 6.3.0.
-
This reply was modified 7 years, 7 months ago by
John Havlik.
Thanks, I will give it a try.