' . category_description() . ''; } } elseif (is_author()) { echo '
'; boozurk_post_details( array( 'date' => 0, 'tags' => 0, 'categories' => 0, 'avatar_size' => 64 ) ); echo '
'; } elseif ( is_page() ) { boozurk_multipages(); } } } // page hierarchy if ( !function_exists( 'boozurk_multipages' ) ) { function boozurk_multipages(){ global $post; $args = array( 'post_type' => 'page', 'post_parent' => $post->ID, 'order' => 'ASC', 'orderby' => 'menu_order', 'numberposts' => 0, 'no_found_rows' => true ); $childrens = get_posts( $args ); // retrieve the child pages $has_herarchy = false; if ( $childrens ) { $the_child_list = ''; foreach ($childrens as $children) { $the_child_list[] = '' . get_the_title( $children ) . ''; } $the_child_list = implode(' | ' , $the_child_list); echo '
 ' . $the_child_list . '
'; // echoes the childs $has_herarchy = true; } return $has_herarchy; } } /* Based on Yoast Breadcrumbs Plugin (http://yoast.com/wordpress/breadcrumbs/) */ if ( !function_exists( 'boozurk_get_the_breadcrumb' ) ) { function boozurk_get_the_breadcrumb() { global $wp_query, $post; $opt = array(); $opt['home'] = __('Home', 'boozurk' ); $opt['sep'] = ' '; $opt['archiveprefix'] = __('Archives for %s', 'boozurk' ); $opt['searchprefix'] = __('Search for "%s"', 'boozurk' ); $nofollow = ' rel="nofollow" '; if (!function_exists('boozurk_get_category_parents')) { // Copied and adapted from WP source function boozurk_get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE){ $chain = ''; $parent = &get_category($id); if ( is_wp_error( $parent ) ) return $parent; if ( $nicename ) $name = $parent->slug; else $name = $parent->cat_name; if ( $parent->parent && ($parent->parent != $parent->term_id) ) $chain .= get_category_parents($parent->parent, true, $separator, $nicename); $chain .= $name; return $chain; } } $on_front = get_option('show_on_front'); if ($on_front == "page") { $homelink = ' '; $bloglink = $homelink.' '.$opt['sep'].' '.get_the_title( get_option( 'page_for_posts' ) ).''; } else { $homelink = ' '; $bloglink = $homelink; } if ( ($on_front == "page" && is_front_page()) || ($on_front == "posts" && is_home()) ) { $output = $homelink.' '.$opt['sep'].' '.''.$opt['home'].''; } elseif ( $on_front == "page" && is_home() ) { $output = $homelink.' '.$opt['sep'].' '.''.get_the_title( get_option( 'page_for_posts' ) ).''; } elseif ( !is_page() ) { $output = $bloglink.' '.$opt['sep'].' '; if ( is_single() && has_category() ) { $cats = get_the_category(); $cat = $cats[0]; if ( is_object($cat) ) { if ($cat->parent != 0) { $output .= get_category_parents($cat->term_id, true, " ".$opt['sep']." "); } else { $output .= ''.$cat->name.' '.$opt['sep'].' '; } } } if ( is_category() ) { $cat = intval( get_query_var('cat') ); $output .= ''.boozurk_get_category_parents($cat, false, " ".$opt['sep']." ").''.' ('.$wp_query->found_posts.')'; } elseif ( is_tag() ) { $title = single_term_title( '', false ); $output .= ''.sprintf( $opt['archiveprefix'], $title ).''.' ('.$wp_query->found_posts.')'; } elseif ( is_404() ) { $output .= ''.__( 'Page not found', 'boozurk' ).''; } elseif ( is_date() ) { if ( is_day() ) { $title = get_the_date(); } else if ( is_month() ) { $title = single_month_title( ' ', false ); } else if ( is_year() ) { $title = get_query_var( 'year' ); } $output .= ''.sprintf( $opt['archiveprefix'], $title ).''.' ('.$wp_query->found_posts.')'; } elseif ( is_author() ) { $author = get_queried_object(); $title = $author->display_name; $output .= ''.sprintf( $opt['archiveprefix'], $title ).''.' ('.$wp_query->found_posts.')'; } elseif ( is_search() ) { $output .= ''.sprintf( $opt['searchprefix'], stripslashes(strip_tags(get_search_query())) ).''.' ('.$wp_query->found_posts.')'; } elseif ( is_attachment() ) { if ( $post->post_parent ) { $output .= ''.get_the_title( $post->post_parent ).' '.$opt['sep']; } $output .= ''.get_the_title().''; } else if ( is_tax() ) { $taxonomy = get_taxonomy ( get_query_var('taxonomy') ); $term = get_query_var('term'); $output .= ''.$taxonomy->label .': '. $term.''.' ('.$wp_query->found_posts.')'; } else { if ( get_query_var('page') ) { $output .= ''.get_the_title().' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('page').''; } else { $output .= ''.get_the_title().''; } } } else { $post = $wp_query->get_queried_object(); // If this is a top level Page, it's simple to output the breadcrumb if ( 0 == $post->post_parent ) { if ( get_query_var('page') ) { $output = $homelink.' '.$opt['sep'].' '.get_the_title().' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('page').''; } else { $output = $homelink." ".$opt['sep']." ".''.get_the_title().''; } } else { if (isset($post->ancestors)) { if (is_array($post->ancestors)) $ancestors = array_values($post->ancestors); else $ancestors = array($post->ancestors); } else { $ancestors = array($post->post_parent); } // Reverse the order so it's oldest to newest $ancestors = array_reverse($ancestors); // Add the current Page to the ancestors list (as we need it's title too) $ancestors[] = $post->ID; $links = array(); foreach ( $ancestors as $ancestor ) { $tmp = array(); $tmp['title'] = get_the_title( $ancestor ); $tmp['url'] = get_permalink($ancestor); $tmp['cur'] = false; if ($ancestor == $post->ID) { $tmp['cur'] = true; } $links[] = $tmp; } $output = $homelink; foreach ( $links as $link ) { $output .= ' '.$opt['sep'].' '; if (!$link['cur']) { $output .= ''.$link['title'].''; } else { if ( get_query_var('page') ) { $output .= ''.$link['title'].' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('page').''; } else { $output .= ''.$link['title'].''; } } } } } if ( get_query_var('paged') ) { $output .= ' '.$opt['sep'].' '.''.__('Page','boozurk').' '.get_query_var('paged').''; } return $output; } }