Lấy tất cả custom taxonomy parent, custom taxonomy child, custom taxonomy (ok)
$taxonomies = array(
'genre'
);
$args = array(
'orderby' => 'name'
);
$terms = get_terms($taxonomies, $args);
foreach ($terms as $term) {
if($term->parent === 0) {
echo $term->name . "<br/>";
}
}

$taxonomies = array(
'genre'
);
$args = array(
'orderby' => 'name'
);
$terms = get_terms($taxonomies, $args);
foreach ($terms as $term) {
echo $term->name . "<br/>";
}

PreviousLấy bài viết, custom post type từ category, post_type, custom taxonomy (ok)Nextwp_add_inline_script không phụ thuộc (ok)
Last updated
Was this helpful?