Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
  • #11820

    Is it possible to make a category invisible in the blog page, but accessible from a separate link item in the menu?


    Hi lotsdesign,

    You could hide the category then go to Appearance > Menus > Categories > Add category to menu. This is the code you’ll need to add to your custom.css or Quick CSS to hide the category from displaying on the Blog.

    .blog-categories {




    Thanks Mya! In that line of code, should i also include the name of the category i want to hide? And where?

    In our case we have a Blog page on the site. On the blog we have a couple of categories. We use the blog function as our news section.

    But we want to have another section called “Trends” which also works as a blog works, with posts. But it should be displayed separately from the news-blog. Do you follow?

    So that’s why i though of making a category for “trends” and display int as a item in the menu. But it also shows up at the news blog as a category.



    Hi lotsdesign,

    I see. Okay, totally ignore my first response then. :) I was thinking you wanted to simply hide the category from displaying on the blog page along with the post date, comments, etc.

    For what you’re looking to do, you need to do edit the query on either template-blog.php or loop-index.php. Let me flag the other support team members to this thread to see if they give you specific instructions.




    You can modify the query in template-blog.php – open up the file and replace:

    $avia_config['new_query'] = array( "paged" => get_query_var( 'paged' ), "posts_per_page"=>get_option('posts_per_page') ) ;


    $avia_config['new_query'] = array( "paged" => get_query_var( 'paged' ), "posts_per_page"=>get_option('posts_per_page'), 'category__not_in' => array( 2,6 ) ) ;

    and instead of the categories (with the id) 2 & 6 enter your category ids you want to exclude. Seperate the ids with commas ( , ).


    What would be the opposite be for including only certain categories? (as opposed to excluding specific ones)

    Also, could I duplicate template-blog.php to something like template-press.php to load as a template with another specific set of post categories?

    Would I be able to for instance then duplicate index.php, call it ‘page-press.php’ with the template part string of “get_template_part(‘template’,’press’);” to load said template as an alternate blog page?

    Or is there just a way to pass an overriding query to the page-press.php page that includes the standard template-blog.php file?




    The opposite would be:

    $avia_config['new_query'] = array( "paged" => get_query_var( 'paged' ), "posts_per_page"=>get_option('posts_per_page'), 'category__in' => array( 2,6 ) ) ;

    A list of all parameters can be found here:


    Hey Dude – been gleening loads of answers to my questions from here (so many thanks!) – but 2 things i can’t see the answer to….

    1) I want to remove the category / author link below each blog post. I have done this successsfully, using the following 2 css codes:

    .blog-author.minor-meta {

    display: none;


    .blog-categories {



    However, there still remains a forward slash (“/”) which used to divide the category and author names. How do i remove this forward slash that remains?

    2) Below each new post in the blog, there should be a “read more ->”, but mine has dissappeared :( How do i get this back for all posts, so visitors don’t have to click the title but can also click “read more” too?

    Thanks so much!



    Hi Alex,

    Can you link us to your site and the blog page that isn’t showing the read more link any longer?




    Hi Dude,

    I tried your code for excluding categories but it didn’t work. The category ID I used was 114 – can that be right? I got it from the manage>categories section and in the URL.

    Is it possible to use the category slug instead of ID number?

    Thanks, Siobhan



    I checked the docs here: and afaik category__not_in does not support category slugs/names.





    Thanks for letting me know.

    This is what my code looks like, is there anything I’m missing?

    The numbers 114, 115, 116, 120 are all category IDs, so not sure where I’ve gone wrong.

    $avia_config = array( “paged” => get_query_var( ‘paged’ ), “posts_per_page”=>get_option(‘posts_per_page’), ‘category__not_in’ => array(114, 115, 116, 120) ) ;

    Thanks! Siobhan



    Yes, it should work this way. Are you using the default blog template?




    Hi Peter,

    I’m using the template-blog.php for the Corona theme, is that right?

    Thanks, Siobhan


    Hi Siobhan,

    Yes, that’s the template used for the blog page (Corona).




    Thanks Ismael.

    I’ve tried both the codes above – one to exclude certain categories and one to include and it doesn’t seem to work either way. Is it possible to use the other parameters in the code instead, e.g. $query = new WP_Query( ‘category_name=staff’ );

    I have a few different categories but two parent categories which I don’t want showing at the same time. So when I go to this page I just want the eBlog parent category and child categories showing (Not Support) and on the following links,

    just the Support parent category and child categories Features, Software Help, Tutorials.

    Could you advise the code to use with this other parameter using the category slug please?

    Also, could you advise the CSS to use to get the archive category titles a specific colour rather than black e.g. color: #107670;

    Thanks, Siobhan



    Here is 6 different dark colored titles/headings i saw on the main page, i labeled some, but was a bit confused about a few, just pop them in one at a time into custom.css, and see the change that was made. You will need to replace the color with the #xxxxxx hex code that you

    /*blurb of text on slide during rollover?*/
    .slideshow_caption {
    color: black;

    /*slider title on roll over?*/
    .slideshow_caption strong
    color: #CF1212;
    /*slider title on roll over?*/
    #top .slideshow_caption h1 {
    color: #CF1212;
    /*blurb of text on slide during rollover?*/
    .featured_caption {
    color: #444;

    h1, h2, .relThumbHeading {
    color: #333;
    /*horizontal line center heading text*/
    .custom_hr_text {
    color: #222;

    Please take a look here, (Purchase code hidden if logged out) -1 , there are 5 blocks of code , I would only keep my eye on block # 2 pr 3 (though looks like 3 hardcoded the ID number)

    You can try on this page, just substitute the number 10 with the parent category number you want to show. (Purchase code hidden if logged out)(Purchase code hidden if logged out) -loop/

    This is the function described

    This is the basic logic when comparing 2 categories to see if one is the ancestor of another, except you would use variables obviously as in the previous example.

    if ( cat_is_ancestor_of(6,20) ) {
    echo '<p>Category 6 is an ancestor of category 20 </p>';
    } else {
    echo '<p>Category 6 is NOT an ancestor of category 20 </p>';

    This is for finding parent categories from a child explained

    If you search on google for ‘wordpress parents categories’ and ‘wordpress child categories’ as I have, there is tons of tutorials, reference and diagrams. Cool stuff!




    Hi Nick,

    Thanks for the reply.

    I’ll have a look at all the links you’ve suggested – the process seems to be a bit more complicated than I thought just to exclude a category so will spend some time reading up!

    For the archive category font, the code you’ve suggested is from the website homepage rather than the archive category page e.g.

    I’m just looking to change the colour of the title ‘Support’ from black to green. I’ve found this CSS code in another Kresi forum (with a different colour code) but it doesn’t seem to change the colour at all.

    .blog-meta .post-meta-infos a {

    color: #272727 !important;


    Please can you advise whether I’m on the right track?

    Thanks, Siobhan



    You would use this to change the color of the word Support on the link you provided,

    #top.archive span.container {
    color: green;

    You should install Google Webdeveloper Tools for Chrome browser, or FireBug for FF/Chrome/Safari, Using them you can easily style the entire page in 15 minutes without knowing css. It’s what I use, since it does all the thinking. lol. Watch this quick video




    Hi Nick,

    Thanks a lot for the code and info about CSS, I’ll give it a go!

    Used the code and works fine. Also found two plugins – Easy Category Management and Ultimate category excluder.

    I’ve managed to exclude the Support posts from the eBlog page which is great, but what I’m looking to do is hide the Support category from the sidebar widget when on the Blog homepage, and on the different support pages, hide the eBlog category.

    So on the blog homepage, the eBlog category would be collapsed in the sidebar widget and no support category showing and on the support archive category, the support category would be collapsed in the sidebar widget and the eBlog category hidden.

    I don’t think this is an issue with parent/child categories as they are both parents.

    To get the collapsible categories, I used Collapsing Categories plugin which has the option to exclude a category which I have done with Uncategorized, but doesn’t seem to allow more than one or choose to hide by different archives/pages.

    I’ve had a look through the code and can’t really get my head around it. The codes I’ve used in previous suggestions haven’t worked either – not sure if it’s an issue with placement in the theme.php (I’ve tried it in a few places) or which the category ID which I’ve double checked and seem to be correct.

    Any help would be really appreciated!

    Thanks, Siobhan



    Add Widget Context Plugin and use it in conjunction with Easy Category Management. or you can use this plugin alone, just add 2 copies of it, and set one copy to show on one page and another to show on a different page, this way in the first copy you can block one set of categories and in another copy you block out another set.

    In any case get widget context also .. this plugin lets you add logic to any widget .. conditional statements, so that you can put 20 copies of the same widget into a sidebar, and have each copy display only when on a certain page or category, or to children of category, etc.. You can use any conditional tag (its easy, no code just tag)

    Here is a video on how to use it

    Watch it, and here is tutorial. Just follow along!

    Best thing to get your head around something, is to follow a video or step by step and doing it without understanding, and then all of a sudden later start understanding it. At least for me. But i’s frustrating and managing stress/frustration is the worst part of learning this stuff.



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

The topic ‘Hide a category from blog?’ is closed to new replies.