• Resolved maqtanim

    (@maqtanim)


    I’ve two categories in blog from where I want to remove the Category Archives text from the page. What I mean is if you go to the following 2 links:
    https://adnan.quaium.com/blog/category/banglablog
    https://adnan.quaium.com/blog/category/englishblog
    you’ll find that in the top of the category archive page there is a text (more like a title) Category Archives: ????? ???? and Category Archives: English Blog. I want to remove the Category Archives: part, so that it will show only category names as ????? ???? and English Blog. At the same time I don’t want to remove the Category Archives: part from the other categories archive pages.

    In the category.php, if I change the following line
    printf( __( 'Category Archives: %s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    to the following line:
    printf( __( '%s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    then all the categories are affected. But I want to change only two certain categories.

    How can I apply the changes only those two categories?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Take a look at the WordPress template hierarchy:

    https://codex.www.ads-software.com/images/1/18/Template_Hierarchy.png

    From that, you will see that you can create files called category-[slug].php

    Your slugs are:

    • banglablog
    • englishblog

    So, in your theme or child theme create files called:

    • category-banglablog.php
    • category-englishblog

    In those files, get rid of the code that displays the text you don’t want.

    Another solution, of course, is to use a multilingual plugin like WPML. You will notice the stuff that says:

    __( 'Category Archives: %s', 'twentyeleven' )

    This is saying to pick up the appropriate translation for the string “Category Archives:”. So you would get the string in English on English pages and the string in Bangla on the Bangla pages.

    You would also not need category lists. You could just have a single blog that would display in the selected language. For example, try going here:

    https://www.friendsofcefnonn.org.uk/wp/

    Select “News” and play about with changing the language from the language selector in the sidebar.

    Thread Starter maqtanim

    (@maqtanim)

    Hi peredur,
    Thanks a lot! The category-[slug].php works for me perfectly. ??
    I checked the site and demo of WPML. It is really a good thing but right now I donot wish to buy a plugin for my personal blog, may be later. ?? But thanks anyway for the suggestion.

    No problem. Glad to be of help.

    PAE

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Twenty Eleven Request] How can I remove the "Category Archives" text?’ is closed to new replies.