WordPress.org

Forums

[resolved] remove "category archives" text from title (22 posts)

  1. rusty.2000
    Member
    Posted 3 years ago #

    HELLO All
    I am trying to remove text from the title. now when i click on pic it is linked to my categories and on that page in title i get "category archives : my category title....ok what i want to do is remove the text "category archives: " part.... i have tried multiple changes in the code in various php in my theme without success....i am using the sliding doors theme by wayne. so if someone can direct me to the appropriate .php where i need to insert or remove some code it would be great my site is onehundredclicks.co.cc

  2. peredur
    Member
    Posted 3 years ago #

    Does this help:

    http://wordpress.org/support/topic/twenty-eleven-request-how-can-i-remove-the-category-archives-text?replies=3#post-2267759

    Basically, you need to look in all the php files that look like *category.php and possibly archive.php and possibly index.php depending on how your theme is dealing with category lists. But somewhere in all those files you should find the code that's outputting the text. Possibly in more than one of the files.

    Just get rid of the code that's outputting the text.

    Hopefully you'll be doing this in a child theme. Much, much better to do it in a child theme.

    Cheers

    PAE

  3. rusty.2000
    Member
    Posted 3 years ago #

    Gee Peredur.. Tks for the quick replay...actually i have not been doing changes in child theme...oops...i will look again in the phps you have listed and come back and also will read the suggested link...
    tks

  4. peredur
    Member
    Posted 3 years ago #

    Does this help in respect of child themes:

    http://wordpress.org/support/topic/how-to-change-tag-to-on-f2-theme?replies=6#post-2267707

    (fourth answer, starting, "No PHP needed...")

    Cheers

    PAE

  5. rusty.2000
    Member
    Posted 3 years ago #

    ok well here is the category.php...listen i am really noob when it comes to code

    <h1 class="page-title"><?php
    printf( __( 'Category Archives: %s', 'slidingdoor' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    ?></h1>
    <?php
    $category_description = category_description();
    if ( ! empty( $category_description ) )
    echo '<div class="archive-meta">' . $category_description . '</div>';

    /* Run the loop for the category page to output the posts.
    * If you want to overload this in a child theme then include a file
    * called loop-category.php and that will be used instead.
    */
    get_template_part( 'loop', 'category' );
    ?>

    </div><!-- #content -->
    </div><!-- #container -->

    <?php get_footer(); ?>

    tks i will back on later

  6. peredur
    Member
    Posted 3 years ago #

    And it's Oops! for me as well. I see I referred you to files that look like *category.php, when I should have said category*.php

    Sorry

    PAE

  7. peredur
    Member
    Posted 3 years ago #

    This is the bit that's outputting the heading:

    <h1 class="page-title"><?php
    printf( __( 'Category Archives: %s', 'slidingdoor' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    ?></h1>

    And this is the bit you don't want:

    'Category Archives: %s'

    The %s represents the category name. So if you want the category name to show, you'll need to change the code above to:

    <h1 class="page-title">
    <span><?php single_cat_title( '', false ); ?></span>
    </h1>

    That should work, I think. Although I'm pretty sure the span element is also redundant. I'd try it without and if all was well I'd leave it out, otherwise just put it back

    You don't need all the printf() stuff and the __() stuff because you're not doing anything multilingual. You've deleted the only thing that could have been translated (i.e. 'Category Archives'), so you can just output the text directly.

    If you don't even want the category name to show you can just delete the whole lot (that is, the whole lot in my first code block above).

    If you're not doing this in a child theme, make sure you take a copy of the original code before you alter it so you can put it back if necessary.

    If you do create a child theme, following the instructions I give in the link I posted, just copy your category.php file to your child theme and alter it there. If you make a mistake just recopy the original from the parent theme back over the file in the child.

    Cheers

    PAE

  8. rusty.2000
    Member
    Posted 3 years ago #

    Wow that is great.......i will do that this morning...as to the the child theme i should do it. i always write down any of the changes i make in a book. i have site backed up and a list of all the plugins i need...i am getting to the child theme...tks for all your help
    and that worked great...i was looking in all the wrong places before

  9. azanmi
    Member
    Posted 3 years ago #

    Hmm can't seem the find the 'Category Archives:' reference in the blogolife theme. I have it installed at stewkeene.com and I would love to be able to remove the 'Category Archives:' reference in category pages.

    Can anyone help?

  10. Hordur Hardarson
    Member
    Posted 3 years ago #

    I'm having the same problem as Azanmi.
    I have gone through all the codes, even copied them into word and looked for category archives: using "find" option, without success.

    Can anyone help us?
    I'll have to use another theme if I can't fix this.

  11. peredur
    Member
    Posted 3 years ago #

    Blogolife is organised differently. The output you are looking to suppress is to be found in content.php:

    <div class="category"><b><?php _e('Category:', 'wplook'); ?></b> <?php the_category(', ') ?><div class="end"></div></div>

    HTH

    PAE

  12. azanmi
    Member
    Posted 3 years ago #

  13. Hordur Hardarson
    Member
    Posted 3 years ago #

    Thank you Peredur.
    I tried to erase the whole line you suggested in content.php

    <div class="category"><b><?php _e('Category:', 'wplook'); ?></b> <?php the_category(', ') ?><div class="end"></div></div>

    But that did not change anything.
    So I put it back in.
    Here you can see the "Category Archives:" before my category name "fr├ęttir".
    http://kollukaffi.com/?cat=10

    Thank you so much for your help.

  14. peredur
    Member
    Posted 3 years ago #

    Well, I've had a quick look, but I can't see offhand where else the text would be. Have you tried contacting the developers? There site is:

    http://wplook.com/blogolife

    And I notice that they have a support page.

    Cheers

    PAE

  15. Hordur Hardarson
    Member
    Posted 3 years ago #

    Thanks, I'll check with them and post the result here.

  16. alchymyth
    Forum Moderator
    Posted 3 years ago #

    the text is quite likely in category.php or achive.php of your theme.

  17. peredur
    Member
    Posted 3 years ago #

    Not this time, alchymyth. I downloaded the theme to see if I could find the text, expecting the same as you. But unless I'm getting very old (which might just be true), this theme does not appear to have those templates. That's what I was referring to in an earlier post.

    Cheers

    PAE

  18. alchymyth
    Forum Moderator
    Posted 3 years ago #

    you are right (i couldn't be bothered to download the theme, not assuming that is 'a bit different')

    found the text in /blogolife/functions/fe/headerdata.php:

    elseif ( is_category() ) {
    	  $content = __('Category Archives:', 'wplook');
    	  $content .= ' ' . single_cat_title("", false);
    	}

    ---
    index.php was referring to get_template_part('inc', 'indexloop' )
    which in turn was using the function <?php wplook_doctitle(); ?>
    which was found in the above mentioned template

    (really - what is the point of programming a theme with this kind of sub-folder structure?)

  19. Hordur Hardarson
    Member
    Posted 3 years ago #

    Thank you both for your help.
    I guess I have to get a FTP client like Filezilla to get into that subfolder and delete the 'Category Archives'.

  20. peredur
    Member
    Posted 3 years ago #

    @alchymyth

    Good catch! I lost the trail somewhere and got stuck in the content*.php templates.

    And I second what you say about using a structure like this. It does seem a bit counter-productive.

    @Hordur Hardarson

    I think I'd start off by altering the file headerdata.php. As a start, I think I'd just comment out the two lines quoted by alchymyth and put in their place:

    $content = "";

    Then I'd check to see what things look like.

    And yes, you'll need an FTP client to do that. Download the file to your local machine, make your alterations and then save them back.

    Cheers

    PAE

  21. azanmi
    Member
    Posted 3 years ago #

  22. Hordur Hardarson
    Member
    Posted 3 years ago #

    Same here ;)

    If I took both lines out and put the $content = ""; instead, I also lost the category name on the top.

    So I only erased the "Category Archives:" and that worked perfectly.

    Before.....
    elseif ( is_category() ) {
    $content = __('Category Archives:', 'wplook');
    $content .= ' ' . single_cat_title("", false);
    }

    After....
    elseif ( is_category() ) {
    $content = __('', 'wplook');
    $content .= ' ' . single_cat_title("", false);
    }

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic