• After an entire day of googling and trying a bunch of different things I sort of have what I want.

    I am trying to display a list of taxonomy terms with the images inside links. With the Taxonomy Images plugin, and random people’s code I now have two lists on my page. One is a list of the taxonomy terms with the links, the other is a list of the images, no links. I need to combine these two so that I am able to display a list of the taxonomy terms, and the image, inside a link. I am not knowledgable enough in php to know how to do this, plus my brain is fried. Please help!

    //list of terms with links
    <?php
    	$taxonomy = 'series';
    	$tax_terms = get_terms($taxonomy);
    ?>
    <ul>
    	<?php
    	foreach ($tax_terms as $tax_term) {
    			echo '<li>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a></li>';
    	}
    	?>
    </ul>
    
    //list of images
       	<?php
    	$terms = apply_filters( 'taxonomy-images-get-terms', '', array('taxonomy' => 'series') );
    		foreach( (array) $terms as $term) {
    			echo wp_get_attachment_image( $term->image_id, 'destacado-proyectos-home' );
    		}
    	?>
Viewing 1 replies (of 1 total)
  • Thread Starter itsmemary

    (@itsmemary)

    I now have a working list of images plus terms without the link, I just need help adding the link from above into this. Every time I try it shows up empty. I know its something simple.

    <?php
    
    echo '<ul class="video-series">';
    $terms = apply_filters( 'taxonomy-images-get-terms', '', array(
         'taxonomy' => 'series'
    ) );
    
    foreach( (array) $terms as $term) {
         echo '<li>' . wp_get_attachment_image( $term->image_id, 'destacado-proyectos-home'). '<span class="termname">' . $term->name . '</span></li>';
    }
    echo '</ul><!-- .video-series -->';
    
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Display Taxonomy Name Images with link’ is closed to new replies.