Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args = array( 'hide_empty=0' );
- $terms = get_terms( 'clothing', $args );
- if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
- //$count = count( $terms );
- //$i = 0;
- $term_list = '<h1 class="text--right">Browse </h1><div class="grid grid--center">';
- foreach ( $terms as $term ) {
- $saved_data = get_tax_meta($term->term_id,'image_field_id',true);
- $attachment_id = $saved_data['id'];
- //$i++;
- $term_list .= '<div class="grid__item palm-one-whole lap-one-half desk-one-third desk-wide-one-quarter soft--ends">';
- $term_list .= '<div class="panel text--center">';
- $term_list .= '<a href="' . get_term_link( $term ) . '" title="View all ' . $term->name . '">';
- $term_list .= '<h2>' . $term->name . '</h2>';
- $term_list .= '<div>' . wp_get_attachment_image( $attachment_id, "full" ) . '</div>';
- $term_list .= '</a>';
- $term_list .= '</div>';
- $term_list .= '</div>';
- }
- $term_list .= '</div>';
- echo $term_list;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement