get taxonomy term id from slug - WordPress
<?php
$term = get_term_by('slug', $slug, 'category');
$name = $term->name;
$id = $term->term_id;
?>
get taxonomy term id from slug - WordPress
<?php
$term = get_term_by('slug', $slug, 'category');
$name = $term->name;
$id = $term->term_id;
?>
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
How do I get current taxonomy "term id" on wordpress?
$obj = get_queried_object();
echo $obj->term_id;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us