If you know the depth that you want you can add a depth parameter to $args
$args = array(
'orderby' => 'id',
'show_count' => '0',
'child_of' => $this_category->term_id,
'use_desc_for_title' => '0',
'taxonomy' => 'product_cat',
'hide_empty' => '0',
'child_of' => $this_category->term_id,
'depth' => 2
);
wp_list_categories($args);
Experiment with that number if it isn’t what you want.
This does not get you “all but the last level” functionality though. It gets you some set number of categories deep. If you want “all but the last level”, I think you will probably have to build a custom Walker.
Related Posts:
- Display list of Sub-Categories and the posts they contain, within one main Category
- Categories list loop – add separator every year
- Exclude a category from the filed under list only on some templates
- Listing all posts from current category on page
- Display only one result from “get_the_category_list”
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- How to find the number of Tags a post has?
- Get woocommerce catogry
- wordpress wp_list_categories
- wp_dropdown_categories and custom taxonomy + custom post type
- Get all sub-categories of a parent category
- Check child/parent categories if exists
- Show Available Taxonomy List with Current Category
- Display the last post by each category?
- List categories with custom code
- limit a list of tags to one category [closed]
- Categories list loop – add separator every 3 categories [closed]
- how to wordpress When I click on the category link, subcategories appear
- new WP_Query all post in a category inside the loop
- get listed category’s id?
- List Child Categorie and hide the parent
- Adding category dropdown list to theme options page
- Hide specific category from wp_list_categories
- How do I add a separator to my list of terms with get_category
- How to show a list of only categories (exclude subcategories)
- Category list with postcount
- Getting the posts list visualised in categories tree
- Return all Tags and Categories in Separate List
- get taxonomy list in a page in the wordpress
- How Can Hide Define Category in Post Contents?
- AZ Directory category
- Search tag within category
- List products from current category
- Way to show content of a post, but if exceeds character limit revert to excerpt?
- list taxonomy based on taxonomy
- Moving Blog and Changing URL
- Get posts from sites in Multisite?
- How to create a custom sort for WordPress categories
- How to add the category ID to admin page
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Category Archive
- WordPress remove separator from last item in wp_list_categories
- Filter categories using tags
- Need help adding custom field to category
- Show Post from parent category (custom taxonomy) ONLY!
- How to display a list of categories
- Create single.php for specific category by category id
- is_category in pre_get_posts results in php notices
- How to make all posts in a category “unsticky”?
- How do I get the total number of categories in a list of search results?
- Update wordpress post terms programatically
- advanced custom field Show field in special categry page [closed]
- Creating archive pages for children categories
- “NOT ONLY IN” taxonomy query operator?
- How to remove the “+Add Category” button from the Category metabox?
- Display the featured image from the last post
- Arrange posts by date in front page
- “Categories” on my front page [closed]
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- How to loop only categories without posts (+ show category featured image with acf) [closed]
- How can I create a Category Index page that lists all categories?
- Add “page-a” slug to category link if user visit category link from “page-a”
- create a page which displays a list of categories title+ short description?
- Scheduling update post daily
- Retrieving category’s color with get_term_meta
- How to exclude children categories of parent category
- Assign category from custom field on post creation and update
- Sticky posts not working when a specific category is set
- Custom category URL rewriting
- Get Number of total Parent Categories for Custom Taxonomy
- Display custom taxonomy attached to the post on post single page
- How to display numbered pages in a category
- How can I add an “ALL CATEGORIES” entry in wp_dropdown_categories?
- Get and show all of the available categories
- how to remove the default title of Categories widget
- Using a rich text editor for category description?
- How to put page numbers with the next/previous on a post/category list?
- Overriding default calendar to show posts from a category
- Categories will only display links to posts
- How to get posts by category at /%category%/ url?
- Echo text using is_tag
- Custom row actions on a specific category
- Show multiple categories in query using redux framework variable
- Add multiple orderby with pre get posts
- new WP_Query issues
- Is custom menu name and category name linked in wordpress?
- How to display a block only for a certain category page
- Get multiple category names from permalink
- How to remove an item from a custom Walker_Nav_Menu
- Dynamically display sub-categories on primary menu without adding them
- display number of posts by category Shortcode
- Custom permalink /%category%/%postname%/ produces 404 on each post
- How to display products with multiple conditions, product_id and category_id
- Split posts into 2 separate streams
- WordPress pagination not working because of subcategory
- Outputting subcategory title AND items on Category page
- Pages, Categories, and working with someone else’s code
- Page permalink rewrite
- Excluding cateory not working on my site. how to solve this? [closed]
- Get all first images of posts in same category
- Woocommerce Force the category choice before creating new product? [duplicate]