Using wp_list_categories
http://codex.wordpress.org/Template_Tags/wp_list_categories
Something like this should give you what you want
$args = array(
'hierarchical' => true,
'hide_empty' => 0,
'title_li' => ''
);
wp_list_categories($args);
Related Posts:
- Limit function to specific post category
- List all categories with featured image from post?
- displaying the categories post
- Highlighting Current Category in the Archive and Feeds page
- List posts that are in the same category as the current post title
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- Can I search posts and pages for css classes?
- Post categories to pages
- Get user categories with most posts in it
- Post page to display specific category
- Get Posts Under Custom Taxonomy
- Get attachments for posts that belongs to a specific category
- Prevent additional top level categories but allow more children
- Need help with category listing!
- Prepending %category% onto default posts fails
- Categories list into registration form
- WP_Query: Mixing category__in and tag__in together
- If in_category not working for multiple single.php pages
- How can I setup a relationship using categories in WordPress?
- WordPress Multisite – Create Default Post and New Category On New Site Install
- how to show single post in a custom template
- Using ajax on editing a category edit page?
- Related posts by category not working right
- How to list recent posts in a wp nav menu?
- Set Default Category to Username
- Disable sticky option for specific categories
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How to add tags (custom taxonomy) to post class css?
- How can I hide tags on a child-category page, if that tag has not been used?
- date issue with category post retrival
- Listing Specific Categories from Current Post with Depth
- How to make multiple sections in home pulling posts category wise?
- How to display two blog categories as separate sections on one page?
- How to make the first post in the loop be styled like a “new / featured” post?
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- Single.php – Get Current Parent Category
- How do I stop the loop from repeating in my category template?
- get_the_category listing in hierarchial order
- Is there a way to specify an extra class for a post or page with no title?
- How to remove in-line style of WordPress’s post content only?
- Is it possible to add/tick a category to a post when it is created?
- Excluding posts not working
- Hide posts belongs to few categories in homepage
- why does wordpress ignore the post args?
- post category in wp_insert_post
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- Conditionals if tags exist?
- How to get subcategories from category slug?
- Remove current category from post but display all others
- How show categories in admin and get that selected to show posts in index
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Showing categories and subcategories with posts
- Change default category when I publish a post
- store posts_id of category into a varable?
- How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- Every second post different class in blog view
- Loop doesn’t exclude the specified category in home page
- Make a vertical dynamic list of posts in alphabetically order and in columns [closed]
- Display posts of specific category term
- Widget that shows categories with posts numbers
- How to create a sub post?
- Post Image not displaying in category view
- How to make different custom post layouts?
- How do I show posts from another wordpress installation?
- Is there any way to stylize articles one by one?
- get posts from Custom Post Type & Category
- Font shows up as Arial instead of Times [closed]
- Category page when using static front page
- Latest posts by category — how to exclude current post?
- show posts under subcategory only when in that subcategory
- How do I include the category next to the title of a post?
- Relative number of post in category
- How to create a “latest news” page showing a list of posts from blog category
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- how to hide empty fields of post category description?
- how can i display my posts alphabetically?
- if in category but only with post meta
- How to get post with associated categories and tags names instead of ids with rest api?
- How to style archive post titles… but only those posts who have comments?
- Display a mixed list of posts and media
- Migrate posts from category and sub-category via SQL
- Parent category / child category posts
- Posts Missing in Dashboard after update
- How to enable custom Shortcodes in Post Category Description? [duplicate]
- Sort by last word in title
- Display post number by category
- singular posts using archive styling
- My Custom Post Type Still Using index.php
- Change Post Title For Specific Category
- Display selected categories onto post page
- How to call posts under a specific category on static front page?
- Give posts a particular template based on the assigned category
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page