Index: post-template.php
===================================================================
--- post-template.php	(revision 31842)
+++ post-template.php	(working copy)
@@ -1807,3 +1807,129 @@
 	echo $rows;
 	echo "</ul>";
 }
+
+/**
+ * Outputs breadcrumb navigation with user arguments for post type and other parameters
+ */
+
+function wp_breadcrumbs( $args = '' ) {
+	$defaults = array(
+		'post_type'      => 'post', 
+		'home_label'     => __( 'Home' ),
+		'item_sep'       => ' &#8250; ',
+		'list_sep'       => ' &#124; ',
+		'show_title'     => true,
+		'start_wrap'     => '',
+		'end_wrap'       => '',
+		'echo'           => true,
+		);
+
+	$params = wp_parse_args ( $args, $defaults );
+
+	$args = apply_filters( 'wp_breadcrumb_args', $params );
+
+	// get args and values
+	global $post;
+	$home_url = home_url( '/' );
+
+	if ( $args['show_title'] ) {
+		$post_title = get_the_title();
+	} else {
+		$post_title = null;
+	}
+
+	$cat_list = get_the_category_list();
+	if ( ! empty ( $cat_list) ) {
+		$post_category = get_the_category_list( $args['list_sep'] ) . $args['item_sep'];
+	} else {
+		$post_category = null;
+	}
+
+	if ( $args['show_title'] == true ) {
+		$post_title = '<span itemprop="title">' . get_the_title() . '</span>';
+	} else {
+		$post_title = null;
+	}
+
+	if ( $args['echo'] ) {
+		$print = true;
+	} else {
+		$print = false;
+	}
+
+	// check for page ancestors
+
+	$par = get_post_ancestors( get_the_id() );
+
+	$pages = get_pages ( array ( 'include' => $par ) );
+
+	foreach ( $pages as $page ) {
+		$parent_list[$page->post_title][] =  get_permalink ( $page->ID );
+	}
+
+	$parent_items = array();
+	foreach ( $parent_list as $key => $value ) {
+		$parent_items[] .= '<a href="' . $value[0] . '">' . $key . '</a>';
+	}
+
+	if ( !empty ( $par ) ) {
+		$processed_parents = implode( $args['item_sep'], $parent_items ) . $args['item_sep'];
+	} else {
+		$processed_parents = null;
+	}
+
+	// output for posts
+	if ( 'post' == $args['post_type'] ) {
+	$output = $args['start_wrap'] . '<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href=" ' . $home_url . '" itemprop="url">' . $args['home_label'] . '</a> ' . $args['item_sep'] . $post_title . '</div>' . $args['end_wrap'];
+		if ( $print ) {
+			echo $output;
+		} else {
+			return $output;
+		}
+	}
+
+	// output for pages
+	elseif ( 'page' == $args['post_type'] ) {
+		if ( $post->post_parent ) {
+			$parent_title = get_the_title ($post->post_parent);
+			$parent_link = get_the_permalink ($post->post_parent);
+			$parent_output = '<a href="' . $parent_link . '">' . $parent_title . '</a>' . $args['item_sep'];
+		} else {
+			$parent_output = null;
+		}
+
+		$output = $args['start_wrap'] . '<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
+		<a href=" ' . $home_url . '" itemprop="url">' . $args['home_label'] . '</a>' . $args['item_sep'] . $processed_parents . $post_title . '</div>' . $args['end_wrap'];
+		if ( $print ) {
+			echo $output;
+		} else {
+			return $output;
+		}
+	} else {
+
+		// output for passed custom post types
+		if ( post_type_exists ( $args['post_type'] ) ) {
+
+			if ( get_post_type_archive_link( $args['post_type'] ) ) {
+				$post_type_name = ucwords ( $args['post_type'] );
+				$archive_url = get_post_type_archive_link( $args['post_type'] );
+				$post_type_archive_link = '<a href="' . $archive_url . '">' . $post_type_name . '</a>' . $args['item_sep'];
+			} else {
+				$post_type_archive_link = null;
+			}
+
+			$output = $args['start_wrap'] . '<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
+			<a href=" ' . $home_url . '" itemprop="url">' . $args['home_label'] . '</a>' . $args['item_sep'] . $post_type_archive_link . $post_title . '</div>' . $args['end_wrap'];
+				if ( $print ) {
+					echo $output;
+				} else {
+			return $output;
+			}
+
+		} else {
+			// nothing if post type is invalid
+			return;
+		}
+	}
+
+}
