$taxonomies = get_object_taxonomies($post->post_type, 'objects'); foreach ($taxonomies as $taxonomy_slug => $taxonomy) { $terms = get_the_terms($post->ID, $taxonomy_slug); if ($terms && !is_wp_error($terms)) { echo '' . $taxonomy->label . ''; foreach ($terms as $term)...
[name]=>珍珠饰品 [slug]=>pearl-jewelry [term_group]=>0 [term_taxonomy_id]=>26 [taxonomy]=>product_cat [description]=>巴洛克,珍珠等原创手作 [parent]=>0 [count]=>12 [filter]=>raw )
代码语言:javascript 代码运行次数:0 运行 AI代码解释$terms = get_the_terms( the_ID(), 'product_cat', array( 'parent' => 84 ) ); foreach ($terms as $term) { $termID = $term->term_id; $name = $term->name; $slug = $term->slug; echo $name; } 然而,这返回了许多结果,我尝试...