You have error in your PHP. This array('parent', $id_parent)
will produce numeric array with two values – string parent
and value of $id_parent
.
What you actually need is array( 'parent' => $id_parent )
which will produce correct associative array with one entry of key parent
and value $id_parent
.
Related Posts:
- Is There a Difference Between Taxonomies and Categories?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Control term order on a per-post basis
- How can I select a primary category?
- Does WordPress Offer a Way to Find All of the Categories that Don’t Have Children?
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- Display empty taxonomy terms with get_terms()
- List Terms in Category
- How can i insert term in a specific language of Polylang?
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Display Posts Loop for each parent and for each Child
- Is There a Difference Between Taxonomies and Categories?
- Get posts under a category with SQL
- get_terms function not returning anything
- Display custom taxonomy attached to the post on post single page
- Display sibling categories on category page
- Combining these queries? (Same taxonomy term + same category as post)
- Get WooCommerce product category list in functions.php
- outputting taxonomy hierarchy
- Display List of Categories Within a Custom Taxonomy
- get_adjacent_post_link excluded_terms ignored
- Why is my post categories not displaying?
- Taxonomy term RestApi data 10 rows limitions
- hide_empty property not working when using get_terms
- When using get_terms with hide_empty = true, terms that only contain scheduled posts are not returned. How to override this?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- get_terms vs. get_categories: does it matter?
- get_categories for custom post type with a specific custom taxonomy attached
- Woocommerce get category image full size
- Order get_terms() By Custom Field
- Could not insert term into the database
- How can I add the featured image functionality to a custom taxonomy?
- Share one taxonomy across multiple blogs in 3.0 [duplicate]
- Fixing category count
- Can a Child Category Have More than One Parent?
- Combine two taxonomies in a hierarchical tree
- Weird behaviour when adding terms/term_taxonomies programmatically
- How can I get category ID by category name?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- get_terms name__like list categories according to letter
- Elegant way to add parent categories?
- wp_update_nav_menu_item() to insert categories
- Programmatically create product category and add thumbnail in woocommerce
- Admin Panel – Disable Moving Selected Terms To Top of Metabox
- How to order the get_categories result
- How to make custom taxonomy check boxes like ‘Categories’
- Create terms when registering taxonomy?
- Send an email when custom post type category is changed
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- How to create non-unique sub-category slugs?
- Excluding posts from a category but only if they’re not in multiple categories
- How to get next previous category in same taxonomy?
- Display only deepest category on a single post?
- Update term count using a callback function
- Get terms that are associated with products from current category
- How to add HTML5 ‘required’ attribute to wp_dropdown_categories() without JavaScripts?
- How to Override default update_count_callback for category
- Wrap a chosen category name with div
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Getting the sub category
- Use get_term_children to get the sub category of a parent category for the current post
- Count argument in get_terms has no effect on ouput/doesn’t work
- Action hooks returning old category instead of new category
- Update wordpress post terms programatically
- wp_list_categories, Add class to all list items with children
- Getting WordPress custom taxonomy/category?
- List all custom post type posts from a given category?
- Get a list of Terms for a specific category
- Return category slug / title from category ID
- Connecting WordPress gallery to custom categories (taxonomy)
- How to get the number of child categories a specific parent category has?
- Get term by slug in Gutenberg
- What’s the difference between “parent” and “category_parent” in a WP_Term object?
- Update taxonomy value of post type in query
- How to query posts from specific authors and categories using WP_query?
- When to use ‘get_category_by_path’ vs. ‘get_term_by’ to get category object from `get_query_var( ‘category_name’ )`?
- How to get the depth of a category’s subcategories
- Category page only displaying the posts from a custom type
- New categories are now going to 404s
- How can I convert some categories to a custom taxonomy?
- Any way to assign Post Categories and Tags to Links?
- Add custom taxonomy under the category title
- Display name of the last child category
- Best way to programmatically link to multiple categories (union/intersection) [closed]
- “Reversable” and “Re-useable” Subcategories (or other taxonomic structure)
- Get multidimensional array that reflects category hierarchy
- Want to hide some categories from the categories meta box in the post editor for the two specific user roles
- How to export/import categories and keep their IDs?
- How to use wp_category_checklist()?
- How to get category URL with the slug?
- Get all sub-categories of a parent category
- How do I get a list of all categories that a given user has written blog posts for?
- Can I use get_adjacent_post for specific categories?
- How to view WordPress’ default category IDs?
- Random taxonomy category list
- display taxonomy slug from term ID
- Taxonomy filter all children
- Set post categories to include parents when setting child category
- How to get data about category in category.php