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
- How can we upload custom page files?
- wp_enqueue_style with style.php and WordPress functions
- Displaying theme options in css
- Input data from email form not going to JSON file
- Show latest posts in a plain HTML website custom widget [closed]
- Category title output before opening title tag
- Hide HTML element (by class or ID) with PHP
- How to remove coupon dropdown feature
- Add html link in functions.php files of the theme
- Handling PHP/HTML inside the output of a shortcode function
- Problem with custom loop and wp_list_pluck [closed]
- jQuery accordion menu
- I have a background-image in css file but don’t show in site.how to fix this prblm. i sent screenshot. thx
- I have a lot of JavaScript erorrs after SSL someone can help me?
- How to center all text body in single.php at once?
- AMP version of e-commerce without plugin
- Vertical Menu for one page only
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- wp nav menu without label
- !in_array doesnt recognize category
- Blog listing not showing dates for every post and arrow missing off image
- Saving meta box data from selected option’s value in database is not working
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- Styling best practices for single pages/templates