Get ID of current taxonomy
-
Hi everbody,
I like to output the ID of the current taxonomy ID I’m using. I’m looking for something like
<?php the_category_ID(); ?>
While searching via Google I found code examples like this:
<?php $terms = get_the_terms( $post->ID , 'taxonomy-name' ); if($terms) { foreach( $terms as $term ) { echo $term->term_id.'<br />'; } } ?>
The problem is that I can’t set the ‘taxonomy-name’, because it’s an unordered list of posts with different taxonomies. So I need something, that WordPress uses automatically the taxonomy-name of the actual post.
Can somebody helps me?
Thank you!
Greetings from Germany,
Raisis
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get ID of current taxonomy’ is closed to new replies.