Skip to content

Instantly share code, notes, and snippets.

@rahuladams
Created June 19, 2020 09:17
Show Gist options
  • Save rahuladams/62498fdfe4d3afc2da7429efa3fd47b4 to your computer and use it in GitHub Desktop.
Save rahuladams/62498fdfe4d3afc2da7429efa3fd47b4 to your computer and use it in GitHub Desktop.
// Breadcrumbs
function get_breadcrumb() {
echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
if (is_category() || is_single()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;";
the_category(' &bull; ');
if (is_single()) {
echo " &nbsp;&nbsp;&#187;&nbsp;&nbsp; ";
the_title();
}
} elseif (is_page()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;";
echo the_title();
} elseif (is_search()) {
echo "&nbsp;&nbsp;&#187;&nbsp;&nbsp;Search Results for... ";
echo '"<em>';
echo the_search_query();
echo '</em>"';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment