Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save onjee/a7331754f2ddbfef91db to your computer and use it in GitHub Desktop.
<?php
function the_breadcrumb() {
echo '';
if (!is_home()) {
echo '<a href="';
echo get_option('home');
echo '">';
echo 'Home';
echo "</a> &raquo; ";
if (is_category() || is_single()) {
the_category('title_li=');
if (is_single()) {
echo " &raquo; ";
the_title();
}
} elseif (is_page()) {
echo the_title();
}
elseif (is_tag()) {
single_tag_title();
}
elseif (is_day()) {
echo "Archive for "; the_time('F jS, Y');
}
elseif (is_month()) {
echo "Archive for "; the_time('F, Y');
}
elseif (is_year()) {
echo "Archive for "; the_time('Y');
}
elseif (is_author()) {
echo "Author Archive";
}
elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
echo "Blog Archives";
}
elseif (is_search()) {
echo "Search Results";
}
elseif (is_404()) {
echo "404 Error";
}
}else{
echo '<a href="';
echo get_option('home');
echo '">';
echo 'Home';
echo "</a>";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment