curente pe termen id
<?php $current_term = get_queried_object()->term_id; ?>
obțineți ID-ul termenului curent
<?php $current_term = get_queried_object()->term_id; ?>
wordpress obține taxonomia curentă
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
echo $term->name; // will show the name
echo $term->slug; // will show the slug
wordpress obține Termeni după taxonomie
You need to pass an additional argument to get_terms(). The default is to hide
"empty" terms-- terms which are assigned to no posts.
$terms = get_terms([
'taxonomy' => $taxonomy,
'hide_empty' => false,
]);
Cum fac rost de curent taxonomie "termen de identificare" pe wordpress?
$obj = get_queried_object();
echo $obj->term_id;