Answers for "wordpress get current term"

PHP
0

get term name wp

$term_name = get_term( $term_id )->name;
Posted by: Guest on June-19-2021
1

get current term id

<?php $current_term = get_queried_object()->term_id; ?>
Posted by: Guest on April-02-2020
0

wordpress get current taxonomy

$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
Posted by: Guest on October-21-2020

Browse Popular Code Answers by Language