Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); //this is alraedy called on top of taxonomy-term.php file ?>
  2.  
  3. <ul class="list-child-pages">
  4. <?php
  5. $args = array(
  6. 'taxonomy' => 'benefit-category',
  7. 'orderby' => 'menu_order',
  8. 'hide_empty' => true,
  9. );
  10. ?>
  11. <?php $benefit_categories = get_terms($args); ?>
  12. <?php foreach ( $benefit_categories as $benefit_category ) { ?>
  13. <li <?php if ( $current_term->slug == $benefit_category->slug ) { ?> class="current-term" <?php } ?>>
  14. <a href="<?php echo home_url(); ?>/benefit-category/<?php echo $benefit_category->slug; ?>"><?php echo $benefit_category->name; ?></a>
  15. </li>
  16. <?php } ?>
  17. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement