• Hi all.
    I need to have a page listing all my terms with title and featured images. I have installed the Wp Term Images plugin and now I need some code that shows me the featured images of all my terms.

    I have the piece of code below that shows me the titles. How can I edit it to shows me the featured images to each title?

    Any help will be fully apreciated.
    Thanks.
    Paulo

    ____________________________________________

     <?php    
          $cat_id = get_query_var('cat');
          $catlist = get_terms('hide_empty=0&child_of=&taxonomy=grupo' . $cat_id);
          echo "<ul>";
          
          foreach($catlist as $categories_item)
          {
          echo '<h1><a href="' . get_category_link( $categories_item->term_id ) . '" title="' . sprintf( __( "" ), $categories_item->name ) . '" ' . '>' . $categories_item->name.'</a> </h1> ';
          
          echo '<div class="">';
              $terms = apply_filters( 'taxonomy-images-get-terms', '' );
              if ( ! empty( $terms ) ) {
          
                foreach( (array) $terms as $term ) {
                  if($term->term_id == $categories_item->term_id) {
                     print '<a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'thumbnail' );
                     echo '</a>';
                  }
              }
              echo '<p>'. $categories_item->description; echo '</p>';
          }
          echo '</div>';
          }
          echo "</ul>";
          ?>
    • This topic was modified 7 years, 12 months ago by rickramalho.
    • This topic was modified 7 years, 12 months ago by rickramalho.
  • The topic ‘Terms Page’ is closed to new replies.