Most of the blog with SEO considerations using breadcrumbs. In this article I am going to show you how to do proper, full breadcrumbs in including nested categories and nested pages. Breadcrumbs are a pretty standard design pattern and can be very useful in a lot of website situations. For WordPress users typically use plugins. But for those who want to add facilities in bredacrumbs WordPress-based blog without using plugins, try my way below.

You can just include this function in your theme’s “functions.php” file.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function get_wp_breadcrumbs() {
	if (!is_home()) {
		echo ('You are here: '); 
		echo '<a href="';
		echo get_option('home');
		echo '">';
		echo 'Home';
		echo "</a> » ";
		if (is_category() || is_single()) {
			the_category(' &raquo; ',multiple);
			if (is_single()) {
				echo " » ";
				the_title();
			}
		} elseif (is_page()) {
			echo the_title();
		}
 
	}
	else { 
	echo ('You are here: '); 
	echo '<a href="';
	echo get_option('home');
	echo '">';
	echo 'Home';
	echo "</a> » ";
	}
}

And then add the following code in the “header.php” file.

108
<?php get_wp_breadcrumbs(); ?>

So there you have it. Fully customizable, valid breadcrumbs in WordPress. Please let me know what you think.