How to add breadcrumbs to WordPress

The graphical control element Breadcrumbs or breadcrumb trail is a navigation aid used in user interfaces. It allows users to keep track of their locations within your website. The term comes from the trail of bread crumbs left by Hansel and Gretel to find their way back home. Below we will write a function that will get the breadcrumbs for the current page. This will need to go into the active theme’s functions.php file.

After you added the the function to your functions.php, you can just call the the_breadcrumb() anywhere you need it in the theme by pasting in the next line. Usually this will go in the header.php file, but you can place it anywhere.