Skip to content

Instantly share code, notes, and snippets.

@kostiantyn-petlia
Created August 9, 2015 03:56
Show Gist options
  • Save kostiantyn-petlia/f8b5094dca81e6a135fd to your computer and use it in GitHub Desktop.
Save kostiantyn-petlia/f8b5094dca81e6a135fd to your computer and use it in GitHub Desktop.
// get current taxonomy-slug in template taxonomy-{taxonomy}.php
$term = get_term_by('slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
echo $term->slug;
// get full info of taxonomy
$the_tax = get_taxonomy( get_query_var( 'taxonomy' ) );
echo $the_tax->labels->name;
// get taxonomy-type current
echo get_query_var('taxonomy');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment