I have a php function to display breadcrumbs, however it display wrong order
for strong text example
Home / Child/ Parent / post
when it should be
Home / Parent / Child / Posts
Why?
Function
function bavota_breadcrumbs() {
if(!is_home()) {
echo '<nav class="breadcrumb">';
echo '<a href="'.home_url('/').'">'.get_bloginfo('name').'</a><span class="divider">/</span>';
if (is_category() || is_single()) {
the_category(' <span class="divider">/</span> ');
if (is_single()) {
echo ' <span class="divider">/</span> ';
the_title();
}
} elseif (is_page()) {
echo the_title();
}
echo '</nav>';
}
}