WordPress custom breadcrumbs without plugin

Breadcrumbs are the important part of our website, in wordpress there are several plugins are available for this, but below i posted the code for custom breadcrumbs for our wordpress site. Just add this below code in to your current wordpress theme functions.php and call the second step.

Step 1

Step 2

After adding the code into functions.php add the below code to where you want to use this function.

I’m a web developer / PHP programmer. I am also working on custom plugin development of wordpress.

  • Well done friend…

  • berez1984bz

    Big thanks to you!

  • gdisalvo

    thanks. I am using it. Is there a way to reverse it and stack the crumbs starting on the left and build out to the right? last-page << third-page << second-page << Home-page
    Incase I wanted to push this into a left hand corner as my right contains date and time stamps?

  • Unity

    Thanx, this helped me alot!

  • Michiel

    This is a good solution, but you could have added more elaborations on the code. Secondly, you might consider adding microdata for the breadcrumbs, so the breadcrumbs will also appear in google search results.

    • daslicht

      Do you have an example for this please ?

  • Sky A.

    Very Helpful. Thanks

  • MicheleBG

    Very cool, it works with WP 3.6. I was wondering how to make it responsive. With max-width:767px do not display breadcrumbs. Via CSS it does not work.

  • bboywattsy

    Works with custom posts.. yay!

  • Salih Kulangara

    Coool…Works Fine, but I want something more, I have custom post type and taxonomies, and how to work with this, In CPT single page I am getting home>Post Type>single post name, I want to show up the taxonomy term also… Like I have this, a Post type Publications, and taxonomy publication_type, and in publication_type terms like article, Poems etc, So I select a post from article, in single page i want to get Home>Publications>Poems>post title…. Is it possible???? Tanx in advance .

    Any How your work is cool, and so helpful. 🙂

  • tholhath

    Thank u

  • PaVen Nguyen

    ok . done task thank for share 😀

  • D

    I got errors on WP 3.8.1 (“headers blah-blah” when I try to edit a post with activated breadrumbs from the template)

  • ilenelfuerte

    thanks, it served me very helpful

  • sam

    not working on a blog page..

  • Pratik

    wow very nice code thnx for help

  • ejaz

    thanks alot it’s very helpful.

  • Thank you very much. such a wonderful tricks. Its really works for me.

  • moustapha

    w el nby enta prince

  • sname

    good job… worked perfectly for me

  • Remus Adrian

    Great job! But i have a question, my blog page is set on home.php, and with this breadcrumb it doesn’t show the blog title nor the blog title before a category. it’s like: Home >> Category >> Post, i want to show like: Home >> Blog >> Category >> Post… how can i do that? Thank you!

  • Renish khunt

    Great dear

  • En Child

    It’s very special, a few ways I use to find breadcrum on my site, just above methods can work. Thank the guest, I am very happy with the tutorial that you gave.

  • Big thanks indeed, I am currently using it and let you know how it performs on my site.

  • WHW

    Wonderful blog & good post. It is really helpful for me, awaiting for more new post. Keep Blogging ! White Hat World >>>>

  • Guest

    Superb… Your code helped us to add breakcumbs to our wordpress blog. Yeah…it just saved us from adding another plugin !!!

    Thank you

  • Jinse jose

    Great post! How to make this breadcrumbs function to noindex?, hide it from SERPs. Please help me out.

  • sfa


  • eae


  • J Munce

    Thanks for the effort. How can I include the sections of the breadcrumb trail this misses?

    This code creates:

    Home » Category » Deeper Category » Current Post Title

    But I need:

    “The actual title of my site” » Category » Deeper Category » Deeper Category » Deeper Category » Deeper Category » “I don’t need current page title”

  • Ludo Briët

    Delimiter doesn’t display correctly on Pages with multiple levels. To fix change line 81 from:

    if ($i != count($breadcrumbs)-1) echo ‘ ‘ . $delimiter . ‘ ‘;


    if ($i != count($breadcrumbs)-1) $returnString .= ‘ ‘ . $delimiter . ‘ ‘;

  • Thank you very much! Really works and is useful.

  • I got this error : Strict Standards: Only variables should be passed by reference in C:xampphtdocswp-theme-devwp-contentthemesviperincviper-functions.php on line 231, what should i do?

  • sid

    Thanks 🙂

  • Tushar Soni

    I could do a PHP implementation to activate breadcrumbs using the following Guide To Install Breadcrumbs: http://www.codingalpha.com/easy-guide-to-add-breadcrumbs-in-wordpress-for-navigation/
    A very simple and easy to set this code:

    This guide helped me to install breadcrumbs in the best possible way and without damaging the PHP code.