Created
December 11, 2022 02:54
-
-
Save namncn/957ef04d539e43e63f10f1eda74848c7 to your computer and use it in GitHub Desktop.
How to get taxonomy/category direct children only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'taxonomy' => 'product_cat', // truyền category/custom taxonomy name vào đây. | |
'parent' => get_queried_object_id(), | |
); | |
$getterms = get_terms( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment