Guest User

Untitled

a guest
Jun 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. $taxonomy = 'range';
  4. $tax_terms = get_terms($taxonomy, array('hide_empty' => false));
  5.  
  6. foreach ($tax_terms as $tax_term) {
  7.  
  8. $image = get_field('illustration', $tax_term);
  9. $size = 'thumbnail';
  10. $thumb = $image['sizes'][ $size ];
  11. echo '<img src="' . $thumb . '">';
  12. echo wp_get_attachment_image( $image, $size );
  13. echo '<span>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></span>';
  14. }
  15. ?>
Add Comment
Please, Sign In to add comment