Skip to content

Instantly share code, notes, and snippets.

@zogot
Forked from Clorith/gist:5500932
Last active December 16, 2015 21:39
Show Gist options
  • Save zogot/5500940 to your computer and use it in GitHub Desktop.
Save zogot/5500940 to your computer and use it in GitHub Desktop.
<?php
function breadcrumbs() {
?>
<?php if ( ! is_home() ) : ?>
<?php global $post; ?>
<a href="<?php bloginfo( 'wpurl' ); ?>">Home</a> &raquo;
<?php
$parent = $post->post_parent;
$parent_title = get_the_title( $parent );
?>
<a href="<?php echo get_permalink( $parent ); ?>"><?php echo $parent_title; ?></a> &raquo;
<?php the_title( '' ); ?>
<?php endif; ?>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment