I’ve got some pages with a custom taxonomy for each page and i’m trying to retrieve this taxonomy on the page. I’d basically need something like the_current_taxonomy()
like the_title()
. This has to run outside the loop cos i’ll use it in a custom WP_Query
right after.
Edit: Found a solution using a different way to retrieve the information i needed. Thanks for your help guys.
Like Rarst, I am confused what you want to output, the taxonomy or the terms of that taxonomy.
Taxonomy can be output for example if you make a template file with the name of that taxonomy: taxonomy-name.php
the title of the taxonomy then becomes:
<h1 class="page-title"><<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?></h1>
The terms within a taxonomy can be output with a tagcloud, see http://codex.wordpress.org/Function_Reference/wp_tag_cloud (but that is within the loop)