I think this will be a simple question for anyone who is familiar with WordPress and PHP. I'm not a PHP guru, so that's why I ask you guys! What we want is simple. Our images have a title and alt desc. But we want to echo them in the theme.
Below is the code where it should be echoed. Yes, I was able to find the piece of code responsible for this ;-). Any suggestions?
while( have_posts() ) :
the_post();
$image = wp_get_attachment_image_src( (int)get_post_meta( get_the_ID() , "_thumbnail_id" , true ) , "collection" );
$large_image = wp_get_attachment_image_src( (int)get_post_meta( get_the_ID() , "_thumbnail_id" , true ) , "original" );
$terms_array = array();
$terms = wp_get_post_terms( get_the_ID() , "brand" );
$brand_image = "";
$has_brand_names = array();
foreach( $terms as $term ) :
if( !$brand_image ) $brand_image = $brand_images["brand-".$term->term_id];
$terms_array[] = "brand-" . $term->term_id;
$has_brand_names[ $term->slug ] = true;
endforeach;
$terms = wp_get_post_terms( get_the_ID() , "collection_subcategory" );
foreach( $terms as $term ) :
$terms_array[] = "subcategory-" . $term->term_id;
endforeach;
printf( "<div class='shoe %s' data-image='%s' data-large-image='%s' ><div class='shoe-outer' ><div class='shoe-inner' ><img src='%s' ></div></div></div>", join(" ", $terms_array ), esc_attr( $image[0] ), esc_attr( $large_image[0] ), $brand_image );
endwhile;