Get Term Info in an Array

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. // This sets out a variable called $term - we'll use it ALOT for what we're about to do.
  2. $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
  4. echo '<h2>' . $term->slug . '</h2>';

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.