'depth'
is not a parameter for the function get_categories()
;
to get only direct child categories, try working with 'parent'
instead of 'child_of'
https://developer.wordpress.org/reference/functions/get_categories/
https://developer.wordpress.org/reference/functions/get_terms/
Related Posts:
- Get the children of the parent category
- Check if a post is in any child category of a parent category
- How to make child categories recognize parent’s template displays
- Show children of top level category only
- How can I make wp_list_categories output li with category-slug as class, for its children?
- Show only first children level of current category?
- Query Posts Exclude Entire Category
- Give Children Unique ID’s
- Check is category parent with ids from the childs – get_term_children
- Check for parent category
- How to create template for children category?
- Need list of child category post titles sorted by child category
- Children categories not shown in dashboard
- list first post of Child Category on Category page
- how to display page title only for child category pages
- How to retrieve posts from parent category, splitting them per children when displayed?
- Control term order on a per-post basis
- Display all posts from all categories with pagination
- is_category() function
- Changing Top Level Items into Radio Buttons in the Categories Meta Box?
- How to create a widgetized sidebar for every category dynamically?
- Display the deepest child category from Category X (in loop)
- Remove “Category Archives: title” at the top of a category page [duplicate]
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- WooCommerce – Display product child categories from specific parent
- Select category in custom query
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Display empty taxonomy terms with get_terms()
- Show list of categories even if they have no posts
- How can I show the subcategories content on the parent category page?
- How to control template resolution if both Author and Category filter in place?
- Resolved – category-slug.php not working after wordpress migration
- How to retain the values from dropdown category lists after wrong form submission?
- Format Brand value in Category view [closed]
- Get multidimensional array that reflects category hierarchy
- Single_cat_title() print the title before text
- Sort posts by post_type in category.php template
- Add Post Screen Keep Category structure
- Possible to make a subdirectory that loops through a single category?
- editing fonts of category links from the_category() funtion
- Archives for each category on WP Multisite
- Update post title with category name after editing a category
- Automatically set default password to all posts in a specific category
- Style wp_list_categories
- Checking for two categories in query_posts
- get_the_categories filter returns an empty array
- Warn me about ‘uncategorized’ posts
- Categories showing page not found
- Why category.php throw 404 in wordpress while calling paginate_links()?
- How to get related tags based on a category?
- Show category to visitors in different name or different language without changing basic category
- Use Tag input metabox style for Categories
- WordPress URL Rewrite for dynamic and customized URL
- Does “show_option_all” in wp_list_categories do anything?
- redirecting from a general category page to another specific one
- Show matching categories in search page
- How to hide category name
- Keyword search in multiple categories
- Targeting Parent Category Pages
- How to do paging in the loop?
- query_posts not reading correct categories
- Displaying list of subcategories and not parent category
- Linking doctors posts to specific services for a medical practice
- Eliminate word from $term->name
- Is there any way to check which wordpress categories was created by which user?
- Showing HTML if Post is In Certain Taxonomy Term
- Category view with contents of [gallery]s shown
- Can I prioritize post categories for choice for breadcrumb trail?
- How can I include custom category and tag base in template files?
- Category List with custom urls
- query_post problem
- Get a list of all links on a page?
- Load the last post of a category
- create function to call category name and slug
- Disable Category Taxonomy
- How to make product image inherit from category image
- Is this process OK to replace URL structure?
- Is it possible to set up blog categories without changing permalink structure
- how to give different template to each subcategory from same parent category?
- No hierarchy in wp_list_categories with child of and depth
- How to check a category checkbox using JavaScript
- Need help to structure our a complex hierarchy
- global categories – Share specific categories in wordpress multisite
- WordPress update 4.7 – the 70.000+ news posts became “Uncategorized”
- How Can Hide Define Category in Post Contents?
- How to auto update post title and slug with category name when post status is updated
- 404 error when i try to search by category or by tag
- Choosing different templates for categories
- Problem with wp_list_categories
- hierarchical taxonomy in permalinks? using same slug
- Display one post on category.php: Wrong featured image
- WordPress Numeric Pagination with Query String [duplicate]
- Changing Permalinks for Category Pages Only
- Taxonomy for custom post type not found
- How can I get this code to only output one link?
- Sorting Woocommerce products by category and attributes
- How to get Woocomerce categories count
- show posts from some category and sort by advance custom field
- sub-category showing up in wrong order in breadcrumbs
- Hierarchical outline of posts