Add Breadcrumbs to WordPress Without a Plugin
Breadcrumbs are a great way to give people a perspective of where they are on your site. In this post I will explain how to add breadcrumbs to WordPress without using a plugin. Adding this feature will also help the search engine spiders to find the structure of your site and decrease the time it takes to index a single page. A lot of wordpress theme developers like to use as few plugins as possible and this code will help you accomplish that.
[php]
<div class="breadcrumbs">
<?php
function breadcrumbs() {
$theFullUrl = $_SERVER["REQUEST_URI"];
$urlArray=explode("/",$theFullUrl);
echo ‘You Are Here: <a href="/">Home</a>’;
while (list($j,$text) = each($urlArray)) {
$dir=";
if ($j > 1) {
$i=1;
while ($i < $j) {
$dir .= ‘/’ . $urlArray[$i];
$text = $urlArray[$i];
$i++;
}
if($j < count($urlArray)-1) echo ‘ » <a href="’.$dir.’">’ . str_replace("-", " ", $text) . ‘</a>’;
}
}
echo wp_title();
}
breadcrumbs();
?>
</div>
[/php]
To include Breadcrumbs in your theme simply place the following where you need them:
[php]
<?php include ( TEMPLATEPATH . ‘/breadcrumbs.php’); ?>
[/php]
You can do the same by creating a function in your functions.php file and then calling the function in your theme.
Using the css class “breadcrumbs” you can style the results to easily blend in with your current theme.
.via { egrace creative }

Pingback by 20 Best Design Posts This Week — December 11, 2009 @ 8:11 pm
[...] Add Breadcrumbs To WordPress Without A Plugin [...]
Comment by Sheree Stoudymire — January 17, 2011 @ 5:08 pm
A great source to post articles, press releases, content, more…. Love these guys!
Pingback by 10 Tips to Make Your WordPress Blog Outstanding - JustAnART — October 26, 2011 @ 8:30 am
[...] Adding Breadcrumbs to WordPress Without Utilizing a Plugin Tags: WordPress Hacks, WordPress Tips Tweet (function() { var s = [...]
Pingback by Popular WordPress Tips for Beginners — December 21, 2011 @ 8:11 am
[...] Adding Breadcrumbs to WordPress Without Using a Plugin [...]