Skip to content

Instantly share code, notes, and snippets.

@oliwa
Created July 25, 2016 08:03
Show Gist options
  • Save oliwa/626e20699a8aca558d8c643201744891 to your computer and use it in GitHub Desktop.
Save oliwa/626e20699a8aca558d8c643201744891 to your computer and use it in GitHub Desktop.
Get Terms from a Custom Post Type: 2 Methods
<!-- Get Taxonomy Title from active Taxonomy -->
<?php // https://wordpress.org/support/topic/taxonomy-title-output ?>
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?>
<!-- List all Taxonomy Terms that are assigned -->
<?php // https://codex.wordpress.org/Function_Reference/the_terms ?>
<?php the_terms( $post->ID, 'glossary-categories', '', ', ', ''); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment