If your theme has body_class() in the body tag (normally in header.php) then the category name is added to the body tag as a class e.g.
<body class="my-category">
So in a css file you can do
.my-category #my-element {
background:#FF0000;
}
To edit the html for the categories to make them card layouts then you would need to edit the category.php file (or create one if your theme is missing it).
Put the html for the cards in the_loop
Related Posts:
- WordPress Shortcode and Dynamic CSS
- Looking to exclude blog posts from category Previous/Next buttons
- Multiple pages on one with different HTML
- Minify HTML, CSS, JS with PHPWee?
- How to display a value from a radio button in the options menu in wordpress
- Different background-image by category
- Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function
- Shortcode content output but not in correct place
- An unwanted inline style is added to my body tag
- Show post in slider
- How can I hide Home in my menu in a specific page?
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- how to remove metadata from the posts of my blog?
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- WP grandchild categories in nested ul li
- selected option if current category is the value
- Customize position of social icons in upme plugin [closed]
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Wrapping a Sidebar within
- Add Codepen animation as Preloader to WordPress
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- Where can I find the inline-css of my theme header?
- Menu Custom Data Attributes
- Highlight the links without using dropdown
- Website completely messes up when logging out
- Need help removing […] after excerpt
- Link to page with posts of specific type
- Displaying images outside the content
- how to changes mobile menu toggle breakpoint in WordPress
- Background image no longer fits to screen now that project is in php files
- List sub categories and corresponding posts of a parent category
- Add other class content with reference class value
- PHP function for horizontal Woocommerce thumbnails and badges
- I can’t go to the page archive-{post_type}.php
- admin panel – How to remove “delete” button from category editing page
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Drop down question
- How to enable HTML tags in category description without breaking the category page
- WP Website is shown in HTML
- Can’t display anything through homepage text editor
- How to find and delete a menu item in php?
- WordPress Slider is not working
- How to display post meta bellow every posts
- how to add functions to my function.php using a child theme?
- Show subcategory name selected in specific category woocoommerce
- Make a full-width wordpress page
- Blog Image and Title in Right Sidebar
- Target a specific container to style on WordPress storefront theme
- How to include different html tags in the header for different pages?
- user update profile for custom code
- Code works on page-example.php by not category-example.php
- Font-Family does not looks like how it should be [closed]
- Where to find the html for WordPress site? [closed]
- How to add style in functions.php depending on conditions?
- Show contact 7 form in popup
- WordPress – Image href for home menu nav not working
- How Can I Center the Logo in the Navigation Menu? [closed]
- featured post as div background
- Trying to customize wordpress drop down categories
- Cant get theme to change footer color through theme customizer
- How to customize posts in WordPress by using HTML and CSS?
- WP_Query not returning results
- Header location [closed]
- How do I link the side images?
- Parse error: syntax error, unexpected ‘}’ in
- Sorting Problem
- How to create a container in php then customise it in CSS
- Custom HTML/CSS Theme into WordPress – SEO considerations
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- How to create different templates for woocommerce single-product.php?
- Editing stylehseet url in head section of WordPress
- separating column the variations from the add to cart button woocommerce
- How can we upload custom page files?
- WordPress override bloginfo variable
- Put CSS inside a PHP file and include it the right way
- Slide in Panel WordPress Post
- Get Post Primary Category
- Correct syntax to html php conversion
- How to properly insert a link to a template in WordPress?
- Custom category code not showing all posts
- Upload Image in a WordPress page using PHP
- Displaying theme options in css
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Problem adding class to body_class
- Removing unneccessary p-tags (Not every p)
- Category Thumbnail Display – How to display ONLY the main Category
- Where do posts get the sidebar from?
- Add a custom stylesheet for BlackBerry
- WordPress automatically adding html tag around PHP code
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- How to get the POST TITLE using the POST ID?
- Customize Time Stamp
- hover image appears below placeholder instead of overlayed
- combine Code 1 with Code 2
- get current product name in functions.php