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.

2-Week 30-40% OFF Promo

<div class="breadcrumbs">


function breadcrumbs() {

$theFullUrl = $_SERVER["REQUEST_URI"];

echo ‘You Are Here: <a href="/">Home</a>’;

while (list($j,$text) = each($urlArray)) {
if ($j > 1) {
while ($i < $j) {
$dir .= ‘/’ . $urlArray[$i];
$text = $urlArray[$i];
if($j < count($urlArray)-1) echo ‘ &raquo; <a href="’.$dir.’">’ . str_replace("-", " ", $text) . ‘</a>’;
echo wp_title();

To include Breadcrumbs in your theme simply place the following where you need them:

<?php include ( TEMPLATEPATH . ‘/breadcrumbs.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 }

19,612 Website Templates and Themes From $3