Wordpress obține taxonomia curentă

Exemple de cod

1
0

curente pe termen id

<?php $current_term = get_queried_object()->term_id; ?>
1
0

obțineți ID-ul termenului curent

<?php $current_term = get_queried_object()->term_id; ?>
0
0

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
0
0

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,
]);
-1
0

Cum fac rost de curent taxonomie "termen de identificare" pe wordpress?

$obj = get_queried_object();
echo $obj->term_id;

În alte limbi

Această pagină este în alte limbi

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................