[Plugin: Taxonomy Images] help getting images.
-
I love this plugin. It is working perfectly. Problem is that I am having trouble getting the code in the documentation to work. I have even watched the tutorial video and the code in that doesn’t work for me. I have been able to get the images out of this way
$terms = apply_filters( 'taxonomy-images-get-terms', '' ); if ( ! empty( $terms ) ) { foreach( (array) $terms as $term ) { print wp_get_attachment_image( $term->image_id, 'menu' ); } }My problem with this is that I can’t figure out how to add my formatting so that I can get the image to display where I want it to. When I do get it to work, it returns 9 images when it should only return 3. I am trying to get this code to work in a custom loop for the categories.
$allcats = get_categories('child_of='.get_query_var('cat')); foreach ($allcats as $cat) : $args = array( 'posts_per_page' => 3, // max number of post per category 'category__in' => array($cat->term_id) ); $customInCatQuery = new WP_Query($args); if ($customInCatQuery->have_posts()) : echo '<div class="menupageContent">'; THIS IS WHERE I NEED THE IMAGES TO SHOW. ONE IN EACH OF THE MENUPAGECONTENT DIVS. echo apply_filters( 'taxonomy-images-queried-term-image', 'menu' ); echo '<h3>'.$cat->name.'</h3>'; echo '<ul>'; while ($customInCatQuery->have_posts()) : $customInCatQuery->the_post(); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; echo '</ul></div><!--end menupageContent-->'; ?>
The topic ‘[Plugin: Taxonomy Images] help getting images.’ is closed to new replies.