Open the page which is rendering the category posts, and in the appropriate place (before running the loop) write the following code
<?php
$catid = get_cat_id();
$color = "#222"; //default;
if ($catid == $pinkCategoryId) $color = "#8B0A50";
else if ($catid == $redCategoryId) $color = "#FF0000";
?>
<style type="text/css">
a { color: <?php echo $color;?>; }
</style>
Now adjust the code block above according to your need
You can also use it by category name instead of category id, just change the get_cat_id to get_the_category() which will return the current category name. Then you can perform the rest of the task as is
Related Posts:
- Can I set a default featured image for a category?
- Hook when category is added to post
- get_categories for custom post type with a specific custom taxonomy attached
- What’s the URL for a category archive?
- Weird behaviour when adding terms/term_taxonomies programmatically
- Exclude categories from Loop, queries, widgets, post navigation
- how to use a different domain/subdomain for authors/catagories on single site?
- WordPress 1 domain multiple blogs
- Category count inside the link
- Is there a way to have duplicate category slugs?
- Multiple level category drop-down
- One WordPress Install, Two Categories. Each Category Gets a Domain
- Name of last category level for a post
- How to add style to category link?
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- Filtering Children of the “uncategorized” Category out of the Loop?
- how to show posts of category random by session
- Remove “Parent” Selection When Adding/Editing Categories?
- Filtering search results
- WooCommerce change category url and product base
- How can we get Catergory / Term Creator
- Seperate WordPress catagories into sepeat list on seperate pages
- Redirect category to first available child post
- Show post only if match all categories
- How do you bulk remove a category from posts?
- How to get product count with respect to categories in WooComerce
- Password protect a specific category page/post
- conditional for sub category on archive page
- Display WordPress Parent Categories Only?
- Filter Home Page Posts in Buddypress [closed]
- Additional featured post on first page
- Assign automatically and manually modify category
- Displaying a full post instead of a slug per category?
- previous/next_post_link in the same sub-category?
- How do I toggle pagination on/off in search results and category listings via a link?
- get_categories() returns “Uncategorised”
- How to show WordPress parent and child category using a different template?
- How can I get categories IDs if multiple categories requested via URI?
- List categories with custom code
- Page display certain Category Posts
- WordPress for Podcast Network
- Categories widget show empty?
- How do I display something on a particular category page?
- Exclude a category from a query that includes its parent category
- Count the posts number for every category
- Add image to each podcast series (or category) in headless WordPress instance [closed]
- Trying to get variables in hacked category dropdown
- Change of category structure will cause two kinds of URLs for one post
- Portfolio Filter Buttons Wont Work
- set terms to category and subcategory
- Woocommerce filter function not updating
- Get Meta Keys of Custom Categories
- Change slug of Standard wp Post category
- Get posts of a custom post type from category from taxonomy?
- How can I ask to an existing category?
- Hide a category of posts from main blog, and only show in category view
- ACF no print data [closed]
- Change categories count to include media attachments
- Get the name of category in query
- Archive filtering
- How can I check which archive has referred the single? [closed]
- Split multiple categories into two columns
- WooCommerce shared categories
- Assignt automatically two categories by author
- Add custom categories and subcategories and posts as custom pages
- pagination 404 error, same slug home and categories
- WordPress 5.4 and higher: Filter posts by category 1 AND category 2 in API requests
- How can I order all subcategories alphabetical independent of the parent categories?
- Add Catgory (assign) to Post Programmatically (without editing)
- Linking to the most recent post in my podcast category
- How to select a parent category and show the children to choose in another select?
- Subcategories in Category Page
- WordPress Portofolio Conditional Templating – functions php
- How can I display categories on different pages
- How to add excerpt and read more button to category archive page
- Icon images across multiple categories
- Is there a way to order categories?
- Categorizing Just Imported Posts
- custom browse by
- Use different file includes for single.php
- How to get related category/categories in WordPress archive page
- How to make all post in to a category?
- In a shared site, how to get products in a category from one site to another?
- Adding a button to a product if it’s in a category, then linking to that category
- Conditions for single post
- Pages with posts filtered by category
- how to get number of posts in a category on a specific date
- Show posted on date only for posts in a certain category
- Page redirecting to category (IE only)
- How to add all categories into an array and extract the categories names and use it with a custom meta box
- Using pagination with multiple loops causes it to break
- get latest post in category date
- How to make wp dropdown category load with selected option on top?
- Query posts that have all the specified tags
- How can I show page per category in wordpress? (Yes, category by page!)
- Random post order into Category Pages
- Why does my category page display “posted on…” when all I want it to do is display categories?
- Remove category number fill
- Taxonomy term RestApi data 10 rows limitions
- Restricted category in Woocommerce [closed]