WordPress.org

Ready to get started?Download WordPress

Forums

Taxonomy Images
Display terms + associated image of a single-post (2 posts)

  1. sanjaypoyzer
    Member
    Posted 8 months ago #

    I am on single-post.php and I want to display my post's taxonomy terms & the term's associated images. Ideally, I'd like the taxonomy description there too. No idea why this has me stumped because it seems like it should be a simple thing to do.

    I have this code, which displays just the post's term's images:

    $terms = apply_filters( 'taxonomy-images-list-the-terms', '', array(
    				'taxonomy' => 'comedians',
    			) );
    
    			foreach( (array) $terms as $term){
    				echo $term;
    			}

    And then I have this code, which displays all of the term's images, with the terms & links & descriptions:

    $terms = apply_filters( 'taxonomy-images-get-terms', '', array(
    				'taxonomy' => 'comedians',
    			) );
    			if ( ! empty( $terms ) ) {
    				print "\n" . '<div class="row">';
    				foreach( (array) $terms as $term ) {
    					print "\n" . '<div class="four columns">';
    					print "\n\t" . '<a href="' . wp_get_attachment_url( $term->image_id ) . '" rel="lightbox unique-woo-feature">' . wp_get_attachment_image( $term->image_id, 'unique-woo-feature' ) . '</a>';
    					print "\n\t" . '<h5>' . esc_html( $term->name ) . '</h5>';
    					print "\n\t" . '<p>' . esc_html( $term->description ) . '</p>';
    					print "\n" . '</div>';
    				}
    				print "\n" . '</div>';
    			}

    What I need is something in between. I understand the crucial part is the filter, specifically the difference between get-terms and list-the-terms but the latter one, which gets the post's terms like I need, doesn't seem to do anything but just the images no matter what I do.

    Any help with this, much appreciated.

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

  2. Manuel Schmalstieg
    Member
    Posted 7 months ago #

    I think I see the mistake... help still needed?

Reply

You must log in to post.

About this Plugin

About this Topic