I am giving solution of my own problem 🙂
<?php
$descendant= array('child_of'=>54);
$categories = get_categories($descendant);
foreach($categories as $category) :
echo $category->name;
endforeach;
?>
Related Posts:
- How to order category.php loop by ‘meta_value’?
- Five posts from a category in footer
- How to get all unique categories for posts in loop?
- Check if loop has any categories?
- wp_query is showing posts from other categories
- WP_Query with one category in args shows other categories
- Function the_posts_pagination() not compatible with WP_Query arguments
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- Get categories within specific term
- How to show specify category template for both parent and child category
- Display 3 levels of categories on page
- I have 3 categories, i want to display on a loop the last 3 of every category
- Retrieving category pages from subcategory returns empty sets
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Main loop querying current template’s info only in custom category archive pages, not my posts
- Pagination only showed when no category is set in wp_query
- Get post count of current loop when using multiple queries on one page
- Exclude or Include category ids in WP_Query
- Display products from specific category in shop page
- Sort posts by custom taxonomy name
- Loop inside the loop
- Looping through tabular data
- Show default content if custom WP_Query has no posts
- Display one latest post from multiple categories
- Display featured products through custom loop in WooCommerce 3 [closed]
- meta_query on a date range using an array of values
- Multiple WP_Query loops with Pagination Not Working
- WooCommerce Only OnSale Products Loop Snippet [closed]
- Apply CSS class to every second database record [closed]
- How to prevent writing duplicate loops?
- ACF – Get lowest & highest value from field
- query user display_name failed in a custom mysql query foreach
- Query posts by specific word on title
- Multiple taxonomy And acf filter group by
- Reset postdata to custom query in nested queries
- How to Filter Posts by Custom Fields?
- Category applied to pages, creates multiple breadcrumb entries after a search query (On the translated site)
- Query posts from category A, and from either category B or C
- Loop Split two Columns
- Combining categories (Query posts with multiple taxonomy terms)
- Filtering out child category posts from parent category archive not working
- How to list posts with disabled/closed comments, with pagination?
- How to make a second query offset -2 from current post
- Limiting number of related posts
- Category ‘pad_counts’ & ‘parent’ conflict
- Custom taxonomy.php not working
- Best choice for multiple loop in page?
- WP Query – order posts by meta field first and then order the rest
- Wp_query with 2 meta keys and array of meta values
- sort and display posts by custom field (wp-query and the loop))
- category__not_in and id values from variable
- How to create custom query by keyword in post title?
- Create a loop on my pages with new “WP_Query”
- WP_Query Taxonomy categories filtering
- WP ForLoop to compare meta information of posts to determine what post to display
- How to filter query loop block with a search string from the query parameters
- Do not duplicate posts with multiple categories in multiple loops
- Different Loop for tag pages?
- More efficient way to list posts by category [duplicate]
- How to access $wp_query object from array of posts given by get_posts?
- Display all attached image of every post of custom post type and link to original post
- 2 queries with counters
- Search.php – return number of results but cannot loop through
- Creating ‘posts page’ loop based on the page itself
- WordPress Queries Not Working?
- Post incorrectly excluded when using “category__in”?
- Use get_cat_ID to retreive multiple category IDs
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- query hook parse_tax_query function takes no effect
- Duplice post with standard WP loop – fixed by using query_posts() instead
- How to display the category dropdown auto search list when key press?
- Categories In English version showing not canonical URL, instead shows query search result
- Check the stored / cached WP_Query with transients on post change
- New template file does not load category-specific post
- Related posts queries
- What code to use in an array to call the current sub-category?
- Pagination for Category does not work
- Custom query for custom post type not getting correct post ID
- Exclude parent categories from recent posts list
- Query post with content only
- WP_Query showing all posts, except from category X, unless it’s also in Y
- Adding Category in WP_Query Not Working
- Why is my query not giving results?
- display all posts from category with and without terms in chronological order
- Continue loop after $queryObject
- active link for most recent post on vertical tabs
- Display Count of posts
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- List ALL posts within last week from current category on category page
- loop through custom post types with meta data
- Using Query In Post Type Archives
- How ‘secure’ are loops?
- Multiple loops on index page with sticky post and pagination
- How to do a loop inside a loop?
- tax_query not working properly with get_posts
- the_excerpt() not working in custom archive
- How can I display sticky posts at first in wp_query?
- List categories using WP_Query
- Show number of posts AND number on current page (cannot make it work)
- Advanced Search – Is this possible?