';
// Do not display on the homepage
if ( !is_front_page() ) {
// Home page
echo '
' . $home_title . '';
echo ' ' . $separator . ' ';
if ( is_single() ) {
// Single post (Only display the first category)
echo '' . $category[0]->cat_name . '';
echo ' ' . $separator . ' ';
echo '' . get_the_title() . '';
} else if ( is_category() ) {
// Category page
echo '' . $category[0]->cat_name . '';
} else if ( is_page() ) {
// Standard page
if( $post->post_parent ){
// If child page, get parents
$anc = get_post_ancestors( $post->ID );
// Get parents in the right order
$anc = array_reverse($anc);
// Parent page loop
foreach ( $anc as $ancestor ) {
$parents .= '' . get_the_title($ancestor) . '';
$parents .= ' ' . $separator . ' ';
}
// Display parent pages
echo $parents;
// Current page
echo ' ' . get_the_title() . '';
} else {
// Just display current page if not parents
echo ' ' . get_the_title() . '';
}
} else if ( is_tag() ) {
// Tag page
// Get tag information
$term_id = get_query_var('tag_id');
$taxonomy = 'post_tag';
$args ='include=' . $term_id;
$terms = get_terms( $taxonomy, $args );
// Display the tag name
echo '' . $terms[0]->name . '';
} elseif ( is_day() ) {
// Day archive
// Year link
echo '' . get_the_time('Y') . ' Archives';
echo ' ' . $separator . ' ';
// Month link
echo '' . get_the_time('M') . ' Archives';
echo ' ' . $separator . ' ';
// Day display
echo ' ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives';
} else if ( is_month() ) {
// Month Archive
// Year link
echo '' . get_the_time('Y') . ' Archives';
echo ' ' . $separator . ' ';
// Month display
echo '' . get_the_time('M') . ' Archives';
} else if ( is_year() ) {
// Display year archive
echo '' . get_the_time('Y') . ' Archives';
} else if ( is_author() ) {
// Auhor archive
// Get the author information
global $author;
$userdata = get_userdata( $author );
// Display author name
echo '' . 'Author: ' . $userdata->display_name . '';
} else if ( get_query_var('paged') ) {
// Paginated archives
echo ''.__('Page') . ' ' . get_query_var('paged') . '';
} else if ( is_search() ) {
// Search results page
echo 'Search results for: ' . get_search_query() . '';
} elseif ( is_404() ) {
// 404 page
echo '' . 'Error 404' . '';
}
}
echo '';
}
?>