Breadcrumb Hack for 1.01
-
Hi,
I created a breadcrumb hack for the index.php. You can see it in action @ my blog. It works with WP 1.01.
function get_breadcrumb($showRoot = true, $rootName = "Home") {
global $p, $m, $author, $blogfilename, $s, $cat, $siteurl, $blogfilename, $tablecategories;
echo "<div id=\"breadcrumb\">";
if ($p || $m || $author || $s || $cat) {
echo "$rootName > ";
if ($p) {
echo ""; the_title(); echo "";
} else if ($m) {
echo "Posts of ";
if (strlen($m) == 6) {
echo "" . date("F Y", strtotime($m."01")) . "";
} else {
echo "" . date("d.m.Y", strtotime($m)) . "";
}
} else if ($author) {
$user = get_userdata($author);
echo "Posts by $user->user_nickname";
} else if ($s) {
echo "Search Results for $s";
} else if ($cat) {
echo "Category " . get_the_category_by_ID($cat) . "";
}
} else if ($showRoot) {
echo $rootName;
}
echo "</div>\n";
}
Post it here in the index.php:
<div id="content">
<?php get_breadcrumb(); ?>
<?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
And yes, I will post it to the wiki shortly.
- The topic ‘Breadcrumb Hack for 1.01’ is closed to new replies.