Creating Breadcrumbs in Wordpress

Problem

How to create breadcrumbs in wordpress.

Solution

To create breadcrubms all you need to do is add the following code into functions.phps

// breadcrumbs function
function the_breadcrumb() {
    // echo "<a href='".get_option('home')."'>" . bloginfo('name') . "</a> » ";
    if (!is_home()) {
        // echo "<a href='".get_option('home')."'>" . bloginfo('name') . "</a> » ";
        echo "<a href='".get_option('home')."'>" . 'Home' . "</a> » ";
        // the_category();
        if (is_category() || is_single()) {
            the_category(' » ');
            if (is_single()) {
                echo " » ";
                the_title();
            }
        } 
        elseif (is_page()) {
            echo the_title();
        }
    }
}

then add this code:

<?php the_breadcrumb(); ?>

to single.php, archive.php etc.