Skip to content

Instantly share code, notes, and snippets.

@schalkburger
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schalkburger/36e03176fc62889b00c6 to your computer and use it in GitHub Desktop.
Save schalkburger/36e03176fc62889b00c6 to your computer and use it in GitHub Desktop.
Simple WordPress page breadcrumbs
function the_breadcrumb() {
global $post;
echo '<ul>';
if (!is_home()) {
$parent_link = get_permalink($post->post_parent);
echo '<li><a href="';
echo $parent_link;;
echo '">';
echo ''.get_the_title($post->post_parent).'';
echo "</a></li>";
if (is_page()) {
echo '<li> &raquo; ';
echo the_title();
echo '</li>';
}
echo '</ul>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment