I have a custom post type called 'rent', inside that custom post type I've assigned some taxonomies like building1, building2 etc, inside that taxonomies I have some terms.
Let's say I have a custom rent post in taxonomy building1 with term 1stfloor.
I'd like to output on that post single page a term name and slug.
I've could have easily done that using
get_post_terms or something similar, but that function requires to specify taxonomy. But I would have many taxonomies for that custom post, and I don't want to make another single.php for every taxonomy.
So I thought I would somehow get the taxonomy of my post (it will always be one taxonomy), assign it to variable, and put as an arg to
get_post_terms. Well you can simply achieve taxonomy of current post using
In my archive page I used
$taxname = get_query_var( 'taxonomy' ); - which works like a charm, but it is not working on custom post single.
Anyone have an idea how I can do that?