On the Codex page for wp_list_categories()
, you can see the two following arguments that might help you:
hide_empty
: Toggles the display of categories with no posts. The default istrue
(hide empty categories).current_category
: Allows you to force thecurrent-cat
CSS class to appear on uses ofwp_list_categories()
that are not on category archive pages.
Note that current_category
only accepts one category ID. If you have a post that belongs to two categories, you will have to choose one.
Related Posts:
- Exclude a ‘portfolio’ custom category?
- Use category base slug in posts’ permalink
- How to control which category will be picked for the slug of a post?
- Change slug with custom field
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- What Defines What Category A Post Picks (if in multiple)
- Permalink Settings: optional settings doesn’t apply to editor
- Display post category in foreach loop with category link
- Using permalinks, category slugs, and tag slugs
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- Get latest post from categories
- How to display only one category in a custom post type?
- displaying the categories post
- Rewriting blog permalinks
- Remove subcategory slug from url
- Can I show category name in url for only one of my categories?
- How do you change the permalink for posts for a single category?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to add a ‘News’ section to specific posts in WordPress
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Point users to a specific url directory for some posts
- Precedence of page permalinks over woocommerce product category links?
- Make assigning post to a specific category equivalent to assigning it to all categories
- Show a Category Specific Info Box
- Older entries link within a category page
- How to display subcategory articles in the category view?
- How can I fixe the article title problem?
- Where is the old post permalink slug stored?
- Manipulate post category after time
- Update all posts automatically when using post_meta
- Categories box not showing on post edit pages
- Add custom field to all posts in specific category
- is there a better way of combining this?
- Looking to exclude blog posts from category Previous/Next buttons
- Some posts returning 404 instead of displaying post
- Using a javascript file to access a get posts array
- get_permalink executes link without https
- How to Add ‘Post Categories’ to the Dashboard Sidebar
- Create pretty permalink for a post knowing the permalink structure
- Link post permalinks to subdirectory /post
- Remove permalink from images when inserting into post
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- Full Width Main Post
- how to set beforsend option in wordpress ajax methods
- Plain permalinks not working!
- Insert woocommerce products programmatically with featured image and gallery
- How to do set post permalinks using 6 digit random unique function?
- Customize permalink wordpress category id
- Pulling in post category and children within category
- Post categories to pages
- WP_Query: Mixing category__in and tag__in together
- Any way for get_next_post() to use the actual post order instead of publish order?
- If in_category not working for multiple single.php pages
- Set Default Category to Username
- Custom order for Mysql array
- Why does WP_Post not contain its permalink?
- Single.php – Get Current Parent Category
- How show categories in admin and get that selected to show posts in index
- Custom Permalink Structure for Pages & Posts
- Add new post in existing categories using wp_insert_post
- singular posts using archive styling
- Display selected categories onto post page
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Post/page title to permalink transformation – what is behind the scenes?
- Change the background of each post according to the category
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- Making posts permalinks consistent numbers
- How to show category based post in home page?
- How to view all posts (on site, not admin) that are uncategorized?
- How to create a list of links to post with specific category
- Set Default Post as Parent Child (Nested) Relation
- Display Current Posts Category (with the most posts)?
- How can I add random alphabets in wordpress permalink posts structure
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- ACF date picker to trigger category change
- Get category slug of the Parent category of a Product
- exclude particular category in api
- Make categories appear random
- WP posts using index.php instead of single.php
- How to make a page show posts only from specific categories without editing php files
- Custom content using in_category
- Get posts from category from custom query
- How to show posts ordered by random [duplicate]
- How do I generate formatted permalinks as specified in backend options?
- Display new posts categories in separated divs
- Add Categories To Custom Post
- Permalink base only for posts
- Query posts from newest category
- Display Posts by Categories
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- Ajax – Post Categories and Load More
- Edit Posts Page but not category specific pages?
- How to organise post by category and date
- Show post if in category
- How to display custom content in post with category XXX
- Displaying categories items among posts
- Display ONLY Latest Post From Several Categories
- Show all posts in category
- Polylang – display one post into 3 categories with different lang [closed]