We’ve created a custom function called get_breadcrumb() to generate the breadcrumb links. You only need to add the get_breadcrumb() function code in functions.php file of the current theme.
function get_breadcrumb() {
echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo " » ";
echo the_title();
} elseif (is_search()) {
echo " » Search Results for... ";
echo '"<em>';
echo the_search_query();
echo '</em>"';
}
}
Display Breadcrumbs:
Call the get_breadcrumb() function in single.php file and others files where you want to display the breadcrumbs on your WordPress site.
<div class="breadcrumb"><?php get_breadcrumb(); ?></div>
https://www.codexworld.com/wordpress-how-to-display-breadcrumb-without-plugin/