Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24688

    Hi,

    I would like to add additional text to the breadcrumbs of the category and the tag archive pages like this:

    before the category resp. the tag name, I would like to add “Kategorie:” resp. “Stichwort:” in the breadcrumbs.

    Where can I change this please?

    Thanks.

    #124362

    Open up wp-contentthemesenfoldframeworkphpclass-breadcrumb.php and serarch for

    /* Get the path to the term archive. Use this to determine if a page is present with it. */
    if ( is_category() )
    $path = get_option( 'category_base' );
    elseif ( is_tag() )
    $path = get_option( 'tag_base' );
    else {
    if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front )
    $path = trailingslashit( $wp_rewrite->front );
    $path .= $taxonomy->rewrite['slug'];
    }

    and add your text to the $path variable like

    /* Get the path to the term archive. Use this to determine if a page is present with it. */
    if ( is_category() )
    $path = 'Kategorie ' . get_option( 'category_base' );
    elseif ( is_tag() )
    $path = 'Stichwort ' . get_option( 'tag_base' );
    else {
    if ( $taxonomy->rewrite['with_front'] && $wp_rewrite->front )
    $path = trailingslashit( $wp_rewrite->front );
    $path .= $taxonomy->rewrite['slug'];
    }

    #124363

    thanks, but this has no effect – by the way, I use CORONA, not ENFOLD.

    This is what I have changed in class-breadcrumbs.php:

    /* Get the path to the term archive. Use this to determine if a page is present with it. */

    if ( is_category() )

    $path = 'Blogkategorie ' . get_option( 'category_base' );

    elseif ( is_tag() )

    $path = 'Stichwort ' . get_option( 'tag_base' );

    else {

    if ( $taxonomy->rewrite && $wp_rewrite->front )

    $path = trailingslashit( $wp_rewrite->front );

    $path .= $taxonomy->rewrite;

    }

    “Blogkategorie” and “Stichwort” does not appear in the Breadcrumbs on a category archive page like this one:

    http://www.kriesi.at/themes/corona/category/news-stuff/

    #124364

    Yes, sorry – I mix up the themes :) – for Corona replace:

    if(is_tax()){
    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    return $term->name;

    }

    if(is_category()){
    $category = get_the_category();
    $i = $category[0]->cat_ID;
    $parent = $category[0]-> category_parent;

    if($parent > 0 && $category[0]->cat_name == single_cat_title("", false)){
    echo get_category_parents($parent, TRUE, $markup, FALSE);
    }
    return single_cat_title('',FALSE);
    }

    with

    if(is_tax()){
    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    return 'Kategorie ' . $term->name;

    }

    if(is_category()){
    $category = get_the_category();
    $i = $category[0]->cat_ID;
    $parent = $category[0]-> category_parent;

    if($parent > 0 && $category[0]->cat_name == single_cat_title("", false)){
    echo 'Kategorie ' . get_category_parents($parent, TRUE, $markup, FALSE);
    }
    return 'Kategorie ' . single_cat_title('',FALSE);
    }

    and

    if(is_tag()){ return "Tag: ".single_tag_title('',FALSE); }

    with

    if(is_tag()){ return "Stichwort: ".single_tag_title('',FALSE); }

    #124365

    Thanks a lot, all works fine now!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Adding text to the breadcrumbs of the category and tag archive pages’ is closed to new replies.