• Resolved CoconutJROTC

    (@coconutjrotc)


    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.

Viewing 15 replies - 1 through 15 (of 21 total)
  • I’m trying to accomplish this too. I’ll let you know if I find a solution.

    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:

    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.

    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.

    Thread Starter CoconutJROTC

    (@coconutjrotc)

    Thank you so much that helped!

    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.

    @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.

    @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.

    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?

    OK, so after that teaser, you need to tell us how you switch them off ??

    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.

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

    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.

    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.

    @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.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Hiding "Category Archives"’ is closed to new replies.