• I have an Issue Based site, with “Editions” as a custom taxonomy for the custom post type “Articles” . I want to display the “cover” (image) for each “Edition” in a page where I list all the “Editions”. I can get the list of terms, but I have no Idea about how to display the image for each edition. I can display the image when I’m in each edition. I’m using “Taxonomy Images” to attach the images to each “Edition”.

    Here is what I have so far… (I know is nothing, but may help to explain what I want to achive)


    <?php
    $terms = get_terms("ediciones");
    $count = count($terms);
    if ( $count > 0 ){
    echo "

    ";
    }
    ?>

    http://wordpress.org/plugins/taxonomy-images/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Animalejourbano

    (@animalejourbano)

    I need some help, please!

    <?php
    $terms = get_terms("ediciones");
    $count = count($terms);
    if ( $count > 0 ){
    echo "<ul>";
    foreach ( $terms as $term ) {
    echo "<li>" . '<a href="' . get_term_link( $term ) . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a>' . "</li>";
     }
    echo "</ul>";
    }
    ?>
    Thread Starter Animalejourbano

    (@animalejourbano)

    I’ve found the solution in this post and goes like this:

    <?php
    
    $terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy' => $thistax) );
    $terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy'=>'ediciones', 'image_size' => 'medium', 'term_args' => 'hide_empty=0', 'order' => 'ASC' , 'orderby' => 'title', 'count'   => 2) );
    
    echo '<ul class="ediciones clearfix">';
    foreach( (array) $terms as $term){
    		  echo '<li>';
    		  echo '<a href="' . esc_url( get_term_link( $term, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'thumb' ) . '<h4>'. sprintf(__('%s', 'my_localization_domain'), $term->name) . '</h4>' . '</a>';
    	  	  echo '</li>';
    	}
    echo '</ul>';
    
    ?>

    But it does not “respect” the order, orderby or count

    .C

    (@lemonthirst)

    Thank you! i was searching for a solution like this one for a while.

    Thanks Animalejourbano, is there a way to get also the last post for each taxonomy?

    Thank you Animalejourbano!
    It works great!

    Thread Starter Animalejourbano

    (@animalejourbano)

    Sorry Topetiggna, but I don’t know how to achive that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘List of terms with images’ is closed to new replies.