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?
- How to limit displayed posts on wordpress
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- WordPress list posts from sub categories
- I want to show category in the post title , how can I do
- How can I remove posts of a certain category from homepage after a specified time period?
- Select a random post from a specific category?
- Articles are text-only in any “Category” instead of HTML
- Mark menu item as current-menu-item for category
- Dynamically generate child-URLs for posts or custom posts
- Random post category URL
- Bulk update post slugs through database
- How To Remove Certain category Posts From the Blog Page
- How to display related posts by subcategory and not parent category
- How to set up multiple taxonomies for groups of posts
- Accessing post->ID outside of the loop for listing child pages
- How to filter posts that belong to a specific category only if that is the only category
- How can i sort the categories by ID
- Full Width Main Post
- Category List (Archive) Page Template By Category
- Category Template: Need to display different content on first page of archives
- Display posts in three columns by category
- how to set beforsend option in wordpress ajax methods
- Add icon/badge next to posttitle of specific category
- List posts in a given category
- Adding parent pages to posts
- Add ajax load more function using WP API
- How to automatically apply a category based on the post title?
- Plain permalinks not working!
- Edit custom post type admin menu link
- Deleted category by mistake, all posts now have categorized category. Can i revert that?
- Direct link to “New post” in specific category?
- How to display category from recent posts?
- How to display WordPress archive into three columns [closed]
- Removing rel=”nofollow” from links posted in Post Content
- Can I divide the pages into categories?
- How to change permalink on post click on post listing page
- Properly display posts on homepage
- Display post X of Y in category
- Get current category id from post page wordpress
- Changing Permalinks for Default Post type to reflect navigation
- How should I add links to other pages/posts from my post?
- Get mixed category random posts
- WordPress not opening posts with only numbers if permalink is post_name
- WordPress Custom Fields (Checkboxes with multiple values)
- Extracting post categories
- Child_of not displaying all children posts.. via get_posts
- Using wp_list_categories like the the_category (showing just current categories of a post)
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Saving category to a post, before publishing the post
- Most liked page not displaying posts
- Duplicate posts and change category
- Should I use posts or pages in this scenario?
- How to make number of blog posts a custom field?
- Category Foreach keeps looping?
- post categories
- Insert woocommerce products programmatically with featured image and gallery
- 200 Rewrite blog post links
- Exclude category from
- How to limit posts by category
- how do I get a specific post from a post with a subcategory in WP
- Add custom post type settings to wordress default posts
- Assign category to new post via URL
- Problem with permalink routing?
- Move first half of posts to one parent page, second half to the other page
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- Stop users posting into category while still seeing contents of the category
- How to check a post exist when the permalink has post id in it?
- Category Page Template not Showing Posts
- display a random post thumbnail from a random category
- How do I retrieve then print the currently viewed sub categories?
- Add multiple tags to multiple posts
- After database migration, posts not showing up in dashboard