Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <div class="class-drop">
  2. <select name="batch_sel" >
  3. <option value="all" <?php if($_GET['batch_sel'] == 'all'){echo 'selected'; } ?> >All </option>
  4. <?php
  5. $terms = get_terms( array(
  6. 'taxonomy' => 'result-year',
  7. 'hide_empty' => false, ) );
  8. $batch_slugs = wp_list_pluck( $terms, 'slug' );
  9. foreach($terms as $term):
  10. ?>
  11.  
  12. <option value="<?= $term->slug ?>" <?php if($term->slug == $_GET['batch_sel']) { echo 'selected';} ?>> <?= $term->name ?> </option>
  13. <?php endforeach ?>
  14.  
  15. </select>
  16. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement