Advertisement
Guest User

Untitled

a guest
Apr 8th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.     $args = array( 'hide_empty=0' );
  3.  
  4.     $terms = get_terms( 'clothing', $args );
  5.     if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
  6.         //$count = count( $terms );
  7.         //$i = 0;
  8.         $term_list = '<h1 class="text--right">Browse </h1><div class="grid grid--center">';
  9.         foreach ( $terms as $term ) {
  10.             $saved_data = get_tax_meta($term->term_id,'image_field_id',true);
  11.             $attachment_id = $saved_data['id'];
  12.             //$i++;
  13.             $term_list .= '<div class="grid__item palm-one-whole lap-one-half desk-one-third desk-wide-one-quarter soft--ends">';
  14.             $term_list .= '<div class="panel text--center">';
  15.             $term_list .= '<a href="' . get_term_link( $term ) . '" title="View all ' . $term->name . '">';
  16.             $term_list .= '<h2>' . $term->name . '</h2>';
  17.             $term_list .= '<div>' . wp_get_attachment_image( $attachment_id, "full" ) . '</div>';
  18.             $term_list .= '</a>';
  19.             $term_list .= '</div>';
  20.             $term_list .= '</div>';
  21.         }
  22.         $term_list .= '</div>';
  23.         echo $term_list;
  24.     }
  25.  
  26.     ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement