Custom Taxonomy images within loop?
-
Hi folks,
I’m struggling trying to figure out how to pull the image from a custom Taxonomy item on a page that lists all items already.
I have a page that is already pulling in all of the Categories (custom taxonomy items) and I want to also pull the individual images I’ve applied to each one.
Here’s some code that outlines what I”m doing currently (without the taxonomy images) – any help on how I’d call the images would be greatly appreciated.
<?php
$post_type = ‘videos’;
$tax = ‘channels’;
$tax_terms = get_terms($tax,’hide_empty=0′);
//list everything
if ($tax_terms) {
foreach ($tax_terms as $tax_term) {
$args=array(
‘post_type’ => $post_type,
“$tax” => $tax_term->slug,
‘post_status’ => ‘publish’,
‘posts_per_page’ => 1,
‘caller_get_posts’=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
?><article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<div class=”entry-featured”>
slug; ?>”>
</div>
</article>
…..Cheers,
Jeff
- The topic ‘Custom Taxonomy images within loop?’ is closed to new replies.