Grüße!
Ich bräuchte ein wenig Hilfe bei einem kleinen Problem. Versuche heute schon den halben Tag den Titel der Beiträge aus den Breadcrumbs zu entfernen, so das nur noch die Kategorien in den Breadcrumbs stehen.
Es geht um diesen Code Abschnitt:
Code
//----------------------------------------------------------------------------------
// ADD BREADCRUMBS FUNCTIONALITY
//----------------------------------------------------------------------------------
function thinkup_input_breadcrumb() {
global $thinkup_general_breadcrumbdelimeter;
$output = NULL;
$count_loop = NULL;
$count_categories = NULL;
if ( empty( $thinkup_general_breadcrumbdelimeter ) ) {
$delimiter = '<span class="delimiter">/</span>';
} else if ( ! empty( $thinkup_general_breadcrumbdelimeter ) ) {
$delimiter = '<span class="delimiter"> ' . $thinkup_general_breadcrumbdelimeter . ' </span>';
}
$delimiter_inner = '<span class="delimiter_core"> • </span>';
$main = __( 'Home', 'melos' );
$maxLength = 30;
/* Archive variables */
$arc_year = get_the_time('Y');
$arc_month = get_the_time('F');
$arc_day = get_the_time('d');
$arc_day_full = get_the_time('l');
/* URL variables */
$url_year = get_year_link($arc_year);
$url_month = get_month_link($arc_year,$arc_month);
/* Display breadcumbs if NOT the home page */
if ( ! is_front_page() ) {
$output .= '<div id="breadcrumbs"><div id="breadcrumbs-core">';
global $post, $cat;
$homeLink = home_url( '/' );
$output .= '<a href="' . esc_url( $homeLink ) . '">' . esc_html( $main ) . '</a>' . $delimiter;
/* Display breadcrumbs for single post */
if ( is_single() ) {
$category = get_the_category();
$num_cat = count($category);
if ($num_cat <=1) {
$output .= ' ' . get_the_title();
} else {
// Count Total categories
foreach( get_the_category() as $category) {
$count_categories++;
}
// Output Categories
foreach( get_the_category() as $category) {
$count_loop++;
if ( $count_loop < $count_categories ) {
$output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '">' . esc_html( $category->cat_name ) . '</a>' . $delimiter_inner;
} else {
$output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '">' . esc_html( $category->cat_name ) . '</a>';
}
}
if (strlen(get_the_title()) >= $maxLength) {
$output .= ' ' . $delimiter . trim(substr(get_the_title(), 0, $maxLength)) . ' ...';
} else {
$output .= ' ' . $delimiter . get_the_title();
}
}
} elseif (is_category()) {
$output .= '<span class="breadcrumbs-cat">' . __( '', 'melos' ) . '</span>' . get_category_parents($cat, true, '') ;
} elseif ( is_tag() ) {
$output .= '<span class="breadcrumbs-tag">' . __( 'Posts Tagged: ', 'melos' ) . '</span>' . single_tag_title("", false);
} elseif ( is_day()) {
$output .= '<a href="' . $url_year . '">' . $arc_year . '</a> ' . $delimiter . ' ';
$output .= '<a href="' . $url_month . '">' . $arc_month . '</a> ' . $delimiter . $arc_day . ' (' . $arc_day_full . ')';
} elseif ( is_month() ) {
$output .= '<a href="' . $url_year . '">' . $arc_year . '</a> ' . $delimiter . $arc_month;
} elseif ( is_year() ) {
$output .= $arc_year;
} elseif ( is_search() ) {
$output .= __( 'Search Results for: ', 'melos' ) . get_search_query() . '';
} elseif ( is_page() && !$post->post_parent ) {
$output .= get_the_title();
} elseif ( is_page() && $post->post_parent ) {
$post_array = get_post_ancestors( $post );
krsort( $post_array );
foreach( $post_array as $key=>$postid ){
$post_ids = get_post( $postid );
$title = $post_ids->post_title;
$output .= '<a href="' . esc_url( get_permalink( $post_ids ) ) . '">' . esc_html( $title ) . '</a>' . $delimiter;
}
$output .= get_the_title();
} elseif ( is_author() ) {
global $author;
$user_info = get_userdata($author);
$output .= __( 'Archived Article(s) by Author: ', 'melos' ) . $user_info->display_name ;
} elseif ( is_404() ) {
$output .= __( 'Error 404 - Not Found.', 'melos' );
} elseif( is_tax() ) {
$output .= get_queried_object()->name;
} elseif ( is_post_type_archive( 'portfolio' ) ) {
$output .= __( 'Portfolio', 'melos' );
} elseif ( is_post_type_archive( 'client' ) ) {
$output .= __( 'Clients', 'melos' );
} elseif ( is_post_type_archive( 'team' ) ) {
$output .= __( 'Team', 'melos' );
} elseif ( is_post_type_archive( 'testimonial' ) ) {
$output .= __( 'Testimonials', 'melos' );
} elseif ( is_post_type_archive( 'product' ) and function_exists( 'thinkup_woo_titleshop_archive' ) ) {
$output .= thinkup_woo_titleshop_archive();
}
$output .= '</div></div>';
return $output;
}
}
Alles anzeigen
Könnt ihr mir da helfen, ich bastel mir jedes mal nen Error. :-?