The WordPress Codex for the wp_list_categories tag is actually pretty helpful here – WordPress is already assigning a class to the < li > tag of the current category.
At that point you just need to add an entry to your theme’s .css file to apply whatever highlighting you want to that class.
For instance:
li.current-cat {
background: #CCC; }
Should give you a nice grey background.
Related Posts:
- How would I get a taxonomy/category list inside a Gutenberg block?
- Gutenberg editor add a custom category as wrapper for custom blocks
- Rewrite rule page url with category
- Different template for subcategories
- WP_Query not looking at child category
- Deleting default category in wordpress
- Redirecting specific category to subdomain
- How to make all posts in a category sticky?
- WordPress: category page not for post’s
- WordPress check if user is logged in from non wordpress page
- Automatically assign posts by author to a specific category
- How to show empty category in admin menus search
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- How do I remove the tags from wp_list_categories?
- How to group the loop posts in a particular by author?
- How to display get_the_category of post showing only CHILD of category “X”
- Get ID of current taxonomy in register_rest_field
- Custom page for WooCommerce’s /product-category/
- Add Class While on Current Post; wp_list_categories
- get all sub categories without specify any category
- How to use wp_category_checklist()?
- Get the name an the description of a link category
- Display child categories in WooCommerce
- WooCommerce duplicate sub categories and product slugs
- Check child/parent categories if exists
- How to run select query of post with category and tags for API?
- WordPress Genesis not excluding category from blog
- How to show only one category in breadcrumb navigation
- Trying to only display 1 category using get_posts
- How to display singular form of category name?
- Populate dropdown based on selection of parent category
- Select posts by name and category per REST API
- Categories for each brands
- Custom User-Created RSS Feed
- query cat orderby and order not working
- Permalinks: display just one kind of wp category in the posts url
- WooCommerce – How to show specific category first-rest of products-specific category last
- Multiple URL’s based on category for one post
- Get value of custom field in category admin
- WordPress category check
- Show category name, and last 5 post titles below category name?
- get_post_meta not working on category.php
- How can I improve this taxonomy treating approach?
- How to show more than 5 posts of the category?
- Can’t delete a category in WordPress
- Dropdown Categories used in form shows no results when all is selected
- Nicer URL for viewing category of posts?
- Get Categories Where Taxonomy Equals ‘n’
- Odd results in get_the_terms vs wp_get_post_terms
- Redirect Changed Permalink on wordpress
- Grandchild Term Things Grandfather Term is It’s Parent
- get full category structure by post id
- Home Page Template – Specific Category
- Remove Archive | from Categories
- Using categories with pages
- Show next post in same category but start from the latest
- List all posts of certain category which share some tags
- Search form options group categories
- Only first category!
- How could I write a get_categories_by_year() function?
- How to add icon over specific thumb
- Can I define multiple paginations on a single page?
- Echo Category Nicename
- Explode() expects a string
- How to add meta description, keywords, custom title to a category template
- User level categories
- Exclude category from drop down list form
- how to remove alphabetical order of category in WordPress?
- How to exit out of delete_categories and stop action?
- Programmatically Create Category and sub Category and sub sub Category
- Parent Category and Subcategory default text generated with category
- How to create a table with counts of category combinations?
- How to get the_category(‘, ‘) with link “title” attribute
- product_cat image url from database
- How to test if the post is in a primary category
- How to get the term id inside the start lvl method of category walker?
- Multiple if statements with else for get_the_category [closed]
- Most efficient way to display current post subcategories?
- Using a template page parent breaks page
- How to display the past events in one of the category?
- How to Query the Top 5 Posts of a specific category?
- How to add a post with new Taxonomy without assigning to default category?
- Query post only from categories that have subcategories
- How to get the link of all categories
- Using wp_list_pages to create 2 lists of pages and include and exclude some of them depending on their category
- How to create default categories in new installs?
- If I change the taxonomy of a post will it get a new time stamp?
- Check if value is a custom taxonomy category name
- Tracking multiple tags or categories
- 2 loops in archive.php (one for each category)
- How to load jquery tag-it plugin into admin?
- Include Category Description in search result
- not empty categories don’t show in menu [closed]
- How do I add and display a custom image field to a category? [duplicate]
- Show parent-child relationship for categories in the wordpress admin
- How to assign different categories to pages in wordpress?
- Add category image before post title on homepage
- All post of child category not in top category
- How to link ACF relationship field to the new Query block in Full Site Editing
- sub-category showing up in wrong order in breadcrumbs