get_category_parents can still be used for #6055
This commit is contained in:
parent
64625ba795
commit
f75855251f
|
@ -38,7 +38,9 @@ if ( ( ! is_home() && ! is_front_page() && ! ( is_post_type_archive() && get_opt
|
||||||
|
|
||||||
if ( 0 != $this_category->parent ) {
|
if ( 0 != $this_category->parent ) {
|
||||||
$parent_category = get_category( $this_category->parent );
|
$parent_category = get_category( $this_category->parent );
|
||||||
echo get_category_parents($parent_category, TRUE, $delimiter );
|
if ( ( $parents = get_category_parents( $parent_category, TRUE, $after . $delimiter . $before ) ) && ! is_wp_error( $parents ) ) {
|
||||||
|
echo $before . $parents . $after . $delimiter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $before . single_cat_title( '', false ) . $after;
|
echo $before . single_cat_title( '', false ) . $after;
|
||||||
|
@ -137,7 +139,9 @@ if ( ( ! is_home() && ! is_front_page() && ! ( is_post_type_archive() && get_opt
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$cat = current( get_the_category() );
|
$cat = current( get_the_category() );
|
||||||
echo get_category_parents( $cat, true, $delimiter );
|
if ( ( $parents = get_category_parents( $cat, TRUE, $after . $delimiter . $before ) ) && ! is_wp_error( $parents ) ) {
|
||||||
|
echo $before . $parents . $after . $delimiter;
|
||||||
|
}
|
||||||
echo $before . get_the_title() . $after;
|
echo $before . get_the_title() . $after;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -159,7 +163,9 @@ if ( ( ! is_home() && ! is_front_page() && ! ( is_post_type_archive() && get_opt
|
||||||
$parent = get_post( $post->post_parent );
|
$parent = get_post( $post->post_parent );
|
||||||
$cat = get_the_category( $parent->ID );
|
$cat = get_the_category( $parent->ID );
|
||||||
$cat = $cat[0];
|
$cat = $cat[0];
|
||||||
echo get_category_parents( $cat, true, '' . $delimiter );
|
if ( ( $parents = get_category_parents( $cat, TRUE, $after . $delimiter . $before ) ) && ! is_wp_error( $parents ) ) {
|
||||||
|
echo $before . $parents . $after . $delimiter;
|
||||||
|
}
|
||||||
echo $before . '<a href="' . get_permalink( $parent ) . '">' . $parent->post_title . '</a>' . $after . $delimiter;
|
echo $before . '<a href="' . get_permalink( $parent ) . '">' . $parent->post_title . '</a>' . $after . $delimiter;
|
||||||
echo $before . get_the_title() . $after;
|
echo $before . get_the_title() . $after;
|
||||||
|
|
||||||
|
@ -174,7 +180,7 @@ if ( ( ! is_home() && ! is_front_page() && ! ( is_post_type_archive() && get_opt
|
||||||
|
|
||||||
while ( $parent_id ) {
|
while ( $parent_id ) {
|
||||||
$page = get_page( $parent_id );
|
$page = get_page( $parent_id );
|
||||||
$breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>';
|
$breadcrumbs[] = $before . '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>' . $after . $delimiter;
|
||||||
$parent_id = $page->post_parent;
|
$parent_id = $page->post_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue