daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Sep 25th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. // Get the term id first
  4. $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
  5. $currentTerm = $term->term_taxonomy_id;
  6.  
  7.  
  8. // This is how you'd use it in your template
  9. wp_list_categories( array(
  10.     'taxonomy' => 'YOUR_TAXONOMY',
  11.     'current_category' => ( isset($currentTerm) ) ? $currentTerm : null
  12. ));
  13.  
  14. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top