Well, I think you could use the CSS begins with selector to select all div’s that begin with category-
div[class*='category-'] #main { width: 300px!important; }
so as you add them, it will still affect any class that begins with them. Then, assuming you have 1 or 2 categories you don’t want to have the property, you could simply override them AFTER the rule above.
div.category-44 #main { /*do something else*/ }
Related Posts:
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Create a full width responsive header image per page
- Remove “Category Archives: title” at the top of a category page [duplicate]
- Hide post meta data on a specific category
- Different excerpt styles per category, but chronological
- Highlight wp_nav_menu when category is selected
- Category location styling
- Hide woocommerce category name from specific pages
- Hide woocommerce category name from specific pages
- Style category link depending on category ID
- Inside a loop, how to change CSS class based on category name?
- Why do I have stray bullet from
- How to add custom color fields to the category edit page?
- Different CSS class by category
- Simple way to style posts of a single category differently in the loop and in single
- Remove Archive | from Categories
- Custom css per category and per single post belong in each category
- Restrict CSS on one page
- Show Secondary Sidebar on Category pages (archive)
- How to get sub-categories to display same look as there parents
- category description not showing in my woocommerce
- Inline If statement to echo CSS [closed]
- How to “remove” WordPress categories UL and make the list loop in a horizontal line?
- Custom Woocommerce Category view
- Broken category styling
- How can i hide the authors box from a specific set of categories and post types?
- How to prevent page re-sizing for mobile browsers [closed]
- How to hide my categories pages’ names, and how as well to reduce the space beween my sidebar’s widgets?
- How can I get the categories and subcategories separately?
- Elementor : display only one category in loop grid
- Get page content by category or tag
- Using categories & “stickyness” together
- Moving Categories submenu to Media, but still opens Posts menu
- Display WooCommerce product categories in a 4 columns custom menu [closed]
- Page with the same name of a category
- How to make category RSS feeds show full content
- How to Check if a Child Category is Being Queried
- Creating Pages that show specific blog categories [closed]
- If a post belongs to two categories how do I choose the main category?
- Change post category based on latest posts views
- Attachment page per category
- How to get the depth of a category’s subcategories
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- functions.php conditional tag – only show in single.php?
- How do I create a way for users to assign categories to a post from the frontend of the website?
- Get categories from save_post hook
- Need to pull parent category and slug – only pulling daughter category
- WordPress category page redirects in .htaccess not working
- Change thumbnail image depending product category
- How to organize custom categories for filtering and selecting
- How to list categories within tags?
- get_next_post set the category
- Different menu navigation per category
- category doesn’t showing up in admin
- Show Posts from Single Category Not Working
- Exclude category from query
- Functions.php: Exclude Category from “Blog”
- How to loop custom post_type from (a) specific category(ies)?
- How to restrict category creation to admins only while allowing editors to still pick category
- Show child taxonomies (that have posts) of the current parent taxonomy
- Query (built in) Categories and Advanced Custom Fields?
- Get next post in same category not working WP 4.7.4
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- Page that links to category content
- Query from multiple category (and)
- Wp Dropdown Category Not Show Current As Title
- How to load several hierarchical categories from functions.php
- How to get the deleted category id?
- Maintaining a separate posts page for certain categories and don’t show those on home page
- WP E-Commerce WPEC 3.8 Sort Categories
- How do I list only children of a specific category in a drop-down?
- Link posts together (relative, not grouped)
- Creating a Blog with numerous categories
- How to hide description on categories and tags?
- Exclude a category from block editor’s category widget
- Replace deprecated get_category_children code with get_terms
- Show category in post page, that is in specific category
- Retrieving Categories based on the first character of the name
- Woocommerce: all products of all categories instead products of one category
- Ajax load more not working with multipler categories
- Assign post category to a page by selecting category from page dashboard
- Category custom template is not showing correct posts
- Assign a class to first element in category in loop
- Using template file for single post in sub-directory multisite
- Category page shows only 1 post when that post has more than 1 category?
- Assign a category to all articles
- How can I modify this code to iterate over an array of categories?
- get_adjacent_post_link excluded_terms ignored
- Include category name in page template
- date.php shows all posts. how to fix it?
- Help with Wp + Mixitup code
- One category not displaying template updates
- Matching usermeta at registration to categories of content
- How do I hide posts in a category from all listings but still allow the posts to be viewed?
- How to show monthly archive posts?
- How to display posts by author in a separate page, other than author.php?
- Exclude category when displaying all categories assigned to a post
- Using same term for slug and category
- How do we ReWrite HTACCESS to point a cat/subcat Product URL, to Cat/ only?