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' ) );
  3.  
  4. echo '<h2>' . $term->slug . '</h2>';

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.