WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] Hiding "Category Archives" (21 posts)

  1. CoconutJROTC
    Member
    Posted 10 months ago #

    Hello.
    I am trying to hide the Category Archives:_____ text. Is there a specific place to go or code to place anywhere that will do this? Thank you for your time and help.

  2. Seahawksean
    Member
    Posted 10 months ago #

    I'm trying to accomplish this too. I'll let you know if I find a solution.

  3. acub
    Member
    Posted 10 months ago #

    If you want to hide the archive titles completely:

    header.archive-header {display: none;}

    Notice that this will hide all the titles from all archives (authors, tags, daily, monthly, yearly, categories).

    If you want to remove only the "Category Archives:" and keep the category's name:

    Install and activate RTFR.
    Replace (left box)

    >Category Archives: <

    with (right box)

    ><

    You might also want to replace (using the same technique):
    Author Archives:
    Tag Archives:
    Daily Archives:
    Monthly Archives:
    Yearly Archives:

  4. Seahawksean
    Member
    Posted 10 months ago #

    Thanx @acub for the quick response.

    I'd prefer to solve this without having to use another plugin. This should be an easy solution.

    I went into Customizr's class-content-post.php file and found this group of code:

    <header class="archive-header">
    
            <h1 class="archive-title"><?php printf( __('Category Archives: %s' ,  'customizr' ), '<span>' . single_cat_title( '' , false ) . '</span>' ); ?></h1>
    
            <?php if ( category_description() ) : // Show an optional category description ?>
              <div class="archive-meta"><?php echo category_description(); ?></div>
            <?php endif; ?>
    
          </header><!-- .archive-header -->

    From this section of code I removed __('Category Archives: %s' , 'customizr' ), which in theory should have removed "Category Archives:" from the article title and leave only the <span> containing the category's title, however it did not. "Category Archives:" is still displayed.

    This should have definitely solved the issue so now I'm not sure if this a Customizr thing or if a WP file is calling "Category Archives:".

    I'll wait to see if anyone else has a solution in the meantime. But if no one can then I'll give your suggestion a try.

    Thanx again.

  5. acub
    Member
    Posted 10 months ago #

    You're welcome.

    %s is the category name in that printf, btw. Here's what you're looking for, if you're into looking. But you'll lose all mods to Customizr core files upon next upgrade.

  6. CoconutJROTC
    Member
    Posted 10 months ago #

    Thank you so much that helped!

  7. Seahawksean
    Member
    Posted 10 months ago #

    I found a pseudo solution for this using just CSS.

    .archive-title {
       visibility: hidden;
    }
    .archive-title span {
       visibility: visible;
       float: left;
    }

    You will have to move the <span> up by adding margin-top: -#px; (at least that's what I did to relign it with the top of the row) since this doesn't completely remove "Category Archives:", is only hides it. It's still there, just not visible and still pushes your category name to the right.

    Hope this helps as it's a pretty easy solution without having to add a plugin.

  8. acub
    Member
    Posted 10 months ago #

    @Seahawksean:
    The principle of having as few plugins as possible is good, because:
    - quite a few plugins are badly written;
    - the more you have, the bigger the chance of incompatibilities, especially through the update process of different parts of your installation.

    But don't overdo it to the point where you forget what a WP plugin is:
    The plugins are a modular system put in place by WordPress to streamline the process of adding code for custom functionality and has been specifically designed to reduce the amount of incompatibilities such additions might bring to an installation.

    Every bit of code you add through functions, custom CSS or by modifying files in your installation could be added by wrapping it up in a plugin, even your code above. So it all comes down to the quality of custom code you add, not to the way you add it (through a plugin or by modifying files yourself).

    Instead of using as few plugins as possible, I think it's wiser to use only high rated ones, that stay up to date and, if you have the possibility to 'asses' the code, well written ones, robust/reliable ones.

    As a side note, I never recommend plugins I haven't tested, except where they seem to do exactly what the user wants and it seems to be the only practical solution. In those cases I specifically point out I haven't tested them myself, so I'm only suggesting, not recommending them.

    Cheers.

  9. Seahawksean
    Member
    Posted 10 months ago #

    @acub,

    Please don't think I'm bashing your suggestion of plugins. I have resorted to using plugins in past websites when no other solution can be found. However, for this website, I am developing it for a client and I don't want them to have to worry about any future plugin updates ruining the layout of or breaking their site. I'm trying to keep the site as simple as possible for them. That's all.

    Plus, I like finding code solutions as it's the best way to learn PHP.

    Thanx again for your input.

  10. acub
    Member
    Posted 10 months ago #

    I always freeze and hide all updates before turning the websites over. Am I the only one to do so? I have WP based websites running without updates for more than 4 years now and people are quite happy with them.

    Why would you even let them know there are updates to a fully functional final product if those updates have the risk of breaking it down, as they wouldn't know how to deal with the potential errors?

  11. ElectricFeet
    Member
    Posted 10 months ago #

    OK, so after that teaser, you need to tell us how you switch them off :-)

  12. Seahawksean
    Member
    Posted 10 months ago #

    Ah, that's excellent advice, @acub. Didn't even realize you could do that! Yes, please share!! That is something I will definitely have to do for a couple of others I'm working on. Thanx!

    But if I don't and they go into their dashboard, they will see the update notifications and get nosy. You know how clients are. lol.

    Oh, and did you not update to ver3.0.10? There certain messed things up quite significantly. That's precisely what I would be concerned with. But, if you could share how one turns off updates than I won't have to worry about it.

  13. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

    If any of the updates are security related, that's not a good idea at all.

  14. acub
    Member
    Posted 10 months ago #

    Back in the days I struggled with functions. Than came Adminimize, which was great, and I used it a lot, but a bit time-consuming. Sometimes I created new roles for the client admins that would control all that was available without breaking the website.
    But now there are plugins to do only that: disable all updates.

  15. WPyogi
    Volunteer Moderator
    Posted 10 months ago #

    Please do note this on that plugin's info page:

    It's very important that you keep your WordPress theme, core and plugins up to date. If you don't, your blog or website could be susceptible to security vulnerabilities or performance issues.

  16. acub
    Member
    Posted 10 months ago #

    @WPyogi: yeah, the terrorists. Well, upon taking this freezing decision for the finished websites I did increase the security measures.

    So far no site was broken. But until I took that decision a lot of them broke due to updates. And it took a lot of my time.

    I acknowledge the risks, I do set backup systems for all websites, just in case, and overall, I'm very happy with my decision.

  17. mikeill
    Member
    Posted 4 months ago #

    Freezing updates is a cool idea. It probably makes sense that any WordPress installation will require some maintenance, which someone needs to be accountable for, or security is seriously at risk.

    Possible options are including it in developers maintenance or hosting fee, letting the client manage it.

    If a client doesn't want to maintain the site, maybe a static html site would make more sense, in which case, "

    You should be able to use any web site mirroring tool to do it, even from using 'wget' from a UNIX box with..

    wget -nc -r http://yoursite.com" (http://wordpress.org/support/topic/export-to-static-html)

  18. mikeill
    Member
    Posted 3 months ago #

    The proper way to hide the header text, "Category Archives:" for the Customizr theme is to duplicate the class-content-headings.php page within your child theme. So if you haven't already created one, add a folder within your child theme called "parts" and copy the class-content-headings.php file from the customizr/parts folder.
    Then remove whatever parts of apply_filters( 'tc_category_archive_title' , __( 'Category Archives :' , 'customizr' ) ), you don't want displayed. This part: __() is actually a function that enables translations.

  19. d4z_c0nf
    Member
    Posted 3 months ago #

    No that's the wrong way. You don't need to do that at all.

    The proper way is using filters the right way.
    So for example
    adding in your child-theme functions.php

    add_filter('tc_category_archive_title',function(){ return ''; });

    Hope this helps.

  20. mikeill
    Member
    Posted 3 months ago #

    Ah yes. You're right. Thank you for that correction.

  21. usdy
    Member
    Posted 2 months ago #

    @ acub: Thanks for the line. Your solution to add header.archive-header {display: none;} to the CSS is slim and easy to add/remove.

Reply

You must log in to post.

About this Theme

About this Topic