Useful

2016.09.25

Custom wordpress breadcrumbs multiple levels function without plugin

In categories: Tutorials, Website development, Wordpress

I was working on a project recently and found out that there is a little bit of a struggle to create breadcrumbs that will display page parent and all ancestors. Most tutorials out there are about two level breadcrumbs navigation.

Therefore I created a function for those who might happen to be in the same position. Simply add this function to your functions.php file and after that call it where you need it.

After you have added this to your functions.php, go to your template and place this function where you would want to display the breadcrumbs with multiple levels:

If you don’t want to display the current page title, then change the second value from true to false.

After this you should see a row with current page parent and all of its ancestors – now go ahead and style the breadcrumbs row using CSS as you need.

Other posts

Your thoughts

 

Latest work