• Hello. I’m new to WordPress but I learn quickly provided the explanation is simple and easy to follow.

    I have a problem that I don’t know how to fix. It’s about styling. This is what I like:

    body.page-id-4470 .post-title {display:none;}
    body.page-id-4470 h2.post-box-title {display: none;}
    body.page-id-4470 .page-title {display:none;}
    body.page-id-4470 a.more-link { display: none;}

    That’s in my global CSS in theme. I want it like that, except the problem is…I only want that not for entire site but for specific categories and tags.

    Let’s for example say I want that as it is for category and tag A, B, C,

    but I want it off for category and tag everything else.

    I have abut 300 category and tags. What do I do? ??

    If it helps, my category uses sub-category. For example: I have Articles and Quotes. Under Quotes, I had subcategories like inspirational quotes, life quotes, funny quote, etc. I want the CSS as it is above for Quotes and all its subcategories. For Articles and its subcategories, I want the CSS off.

Viewing 1 replies (of 1 total)
  • Hello,
    Make a separate CSS file and enqueue CSS file based on the category. For example,

    if ( in_category('mouse', $post->ID)) {
            wp_enqueue_script('mousescript');
        }

    Please find the details info here.
    If you have any more question to ask, feel free for that. I will try my best to help you.
    Note: Child theme is recommended to customize theme.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Want to Apply CSS Style to Certain Categories but not others’ is closed to new replies.