I'm searching for a way to display the current taxonomy slug in a post.
Edited to make it more clearer here a more accurate example.
I have the CPT activites. I have more than 200 article posts about activities, and I want to categorize these into different areas (taxonomy) and different kind of activites. To get more specific, here my example:
Activities (Custom Post Type) - running (Taxonomy) - watersports (Taxonomy) - swimming (Term) - article post about swimming 1 (Post) - article post about swimming 2 (Post) - article post about swimming 3 (Post) - article post about swimming 4 (Post) - diving (Term) - boating (Term) - Kiteboating (Term) - materials arts (Taxonomy) - teamsports (Taxonomy)
If I'm in one of these posts (post about swimming), I want to display the current taxonomy (watersports) inside the article.
I have found a way to get display the current term (Term 1) but unfortunally I need the slug of the active taxonomy slug inside the post. The slug of this taxonomy is finally important, to display a list of more activies beside watersports. I'd try it like this way:
<h4>More activities beside "watersport":</h4> <?php $taxonomy = 'HERE THE SLUG OF CURRENT TAXONOMY'; $orderby = 'name'; $show_count = 0; $pad_counts = 0; $hierarchical = 1; $title = ''; $args = array( 'taxonomy' => $taxonomy, 'orderby' => $orderby, 'show_count' => $show_count, 'pad_counts' => $pad_counts, 'hierarchical' => $hierarchical, 'title_li' => $title ); ?> <ul> <?php wp_list_categories( $args ); ?> </ul>
Thanks for your help!