WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy Images
Getting Child term images (1 post)

  1. elbego
    Member
    Posted 1 year ago #

    I've been playin with this some more and still not getting anywhere:

    Any reason why this would output all the categories/terms but not the term images?

    $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
    
    $args = array(
    						    'taxonomy'     => $current_term->taxonomy,
    							'child_of' 	   => $current_term->term_id,
    							'hide_empty' => false,
    								'term_args'    => array(
    								'orderby'      => 'id',
    								'order'        => 'ASC',
    								'hierarchical' => true,
    								'depth'  => 1,
    
    								),
    
    							);
    
    	$images = apply_filters( 'taxonomy-images-get-terms', '', $args );
    	$cats = wp_list_categories ( $args );
    
    foreach ($cats as $cat) {
    foreach ($images as $image) {
    echo '<li><a href="' . get_category_link($cat) . '" title="'. $cat->name .'">' ;
    echo wp_get_attachment_image( $image->image_id, 'detail' );
    echo $cat->name ;
    echo '</a></li>';
    }
    }

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic