Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get post category info
- $category = get_the_category();
- if ( !empty( $category ) ) {
- // Get last category post is in
- $last_category = end ( array_values( $category ) ); // Line 73
- // Get parent any categories and create array
- $get_cat_parents = rtrim( get_category_parents ( $last_category->term_id, true, ',' ), ',' );
- $cat_parents = explode( ',', $get_cat_parents );
- // Loop through parent categories and store in variable $cat_display
- $cat_display = '';
- foreach ( $cat_parents as $parents ) {
- $cat_display .= '<li class="item-cat">'.$parents.'</li>';
- $cat_display .= '<li class="breadcrumb-separator"> ' . $separator . ' </li>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement