';
global $wp_query;
global $biz_vektor_options;
// get post type
$postType = get_post_type();
// get post type label
$post_type_object = get_post_type_object($postType);
if($post_type_object){
$postTypeName = esc_html($post_type_object->labels->name);
}
// post label
$postLabelName = $biz_vektor_options['postLabelName'];
// post top URL
$postTopUrl = (isset($biz_vektor_options['postTopUrl']))? $biz_vektor_options['postTopUrl'] : '';
$panListHtml .= '
';
$panListHtml .= '- HOME »
';
// 404
if ( is_404() ){
$panListHtml .= "- ".__('Not found', 'bizvektor-global-edition')."
";
} else if ( is_search() ) {
$panListHtml .= "- ".sprintf(__('Search Results for : %s', 'bizvektor-global-edition'),get_search_query())."
";
// post home
} else if ( is_home() ){
$panListHtml .= '- '.$postLabelName.'
';
// page
} elseif ( is_page() ) {
$post = $wp_query->get_queried_object();
if ( $post->post_parent == 0 ){
$panListHtml .= "- ".the_title('','', FALSE)."
";
} else {
$title = the_title('','', FALSE);
$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
array_push($ancestors, $post->ID);
foreach ( $ancestors as $ancestor ){
if( $ancestor != end($ancestors) ){
$panListHtml .= '- '. strip_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ) .' »
';
} else {
$panListHtml .= '- '. strip_tags( apply_filters( 'single_post_title', get_the_title( $ancestor ) ) ) .'
';
}
}
}
// author
} else if (is_author()) {
$userObj = get_queried_object();
$panListHtml .= '- '.esc_html($userObj->display_name).'
';
// single
} elseif ( is_single() ) {
if ($postType == 'post') {
if ($postTopUrl) {
$panListHtml .= '- '.$postLabelName.' »
';
} else {
$panListHtml .= '- '.$postLabelName.' »
';
}
$category = get_the_category();
$category_id = get_cat_ID( $category[0]->cat_name );
if ($category_id) : // memo : case by no tax custom post type
$panListHtml .= '- '. get_category_parents( $category_id, TRUE, ' » ' ).'
';
endif;
// custom post type
} else {
$panListHtml .= '- '.$postTypeName.' »
';
$taxonomies = get_the_taxonomies();
foreach ( $taxonomies as $taxonomySlug => $taxonomy ) {}
if ($taxonomies):
$taxo_catelist = get_the_term_list( $post->ID, $taxonomySlug, '', ' , ', '' );
$panListHtml .= '- '.$taxo_catelist.' »
';
endif;
}
$panListHtml .= '- '.get_the_title()."
";
// taxonomy
} else if (is_tax()) {
if ( $postType == 'post') {
$postTopUrl = (isset($biz_vektor_options['postTopUrl']))? esc_html($biz_vektor_options['postTopUrl']) : '';
if ($postTopUrl) {
$panListHtml .= '- '.$postLabelName.' »
';
} else {
$panListHtml .= '- '.$postLabelName.' »
';
}
// custom post type
} else {
if (get_post_type()) {
$postTypeSlug = get_post_type();
} else {
$taxonomy = get_queried_object()->taxonomy;
$postTypeSlug = get_taxonomy( $taxonomy )->object_type[0];
}
$postTypeName = get_post_type_object($postTypeSlug)->labels->name;
$panListHtml .= '- '.$postTypeName.' »
';
}
$panListHtml .= '- '.single_cat_title('','', FALSE).'
';
// category
} else if ( is_category() ) {
$postTopUrl = (isset($biz_vektor_options['postTopUrl']))? esc_html($biz_vektor_options['postTopUrl']) : '';
if ($postTopUrl) {
$panListHtml .= '- '.$postLabelName.' »
';
} else {
$panListHtml .= '- '.$postLabelName.' »
';
}
$cat = get_queried_object();
// parent = 0 means has parent
if($cat -> parent != 0):
$ancestors = array_reverse(get_ancestors( $cat -> cat_ID, 'category' ));
foreach($ancestors as $ancestor):
$panListHtml .= '- '.get_cat_name($ancestor).' »
';
endforeach;
endif;
$panListHtml .= '- '. $cat -> cat_name. '
';
// tag
} elseif ( is_tag() ) {
if ($postType == 'post') {
if ($postTopUrl) {
$panListHtml .= '- '.$postLabelName.' »
';
} else {
$panListHtml .= '- '.$postLabelName.' »
';
}
// custom post type
} else {
$panListHtml .= '- '.$postTypeName.' »
';
}
$tagTitle = single_tag_title( "", false );
$panListHtml .= "- ". $tagTitle ."
";
// archive
} elseif ( is_archive() && (!is_category() || !is_tax()) ) {
if (is_year() || is_month()){
if ($postType == 'post') {
if ($postTopUrl) {
$panListHtml .= '- '.$postLabelName.' »
';
} else {
$panListHtml .= '- '.$postLabelName.' »
';
}
// custom post type
} else {
$panListHtml .= '- '.$postTypeName.' »
';
}
if (is_year()){
$panListHtml .= "- ".sprintf( __( 'Yearly Archives: %s', 'bizvektor-global-edition' ), get_the_date( _x( 'Y', 'yearly archives date format', 'bizvektor-global-edition' ) ) )."
";
} else if (is_month()){
$panListHtml .= "- ".sprintf( __( 'Monthly Archives: %s', 'bizvektor-global-edition' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'bizvektor-global-edition' ) ) )."
";
}
} else {
if(!isset($postTyeName)){
global $wp_query;
$postTypeName = $wp_query->queried_object->labels->name;
}
$panListHtml .= '- '.$postTypeName.'
';
}
} elseif ( is_attachment() ) {
$panListHtml .= '- '.the_title('','', FALSE).'
';
}
$panListHtml .= '
';
$panListHtml .= '