Display Product Images
-
Hi All,
I am trying to fetch the product images associated with each of the brand logos that are displayed on the link provided. I’d like the product image for each brand logo to appear below the logo. I’ve tried calling the post thumbnail but it’s not working. (I didn’t write the code for this website).
This is how the brand logos are displayed:<section class="section-bg">
<div class="block-banner" style="margin-top:0;">
<div class="container">
<div class="row">
<?php // Display the brands on this page
$brands = product_brands(); // An array of brands
foreach ($brands as $key => $brand) {
$images = get_option('taxonomy_image_plugin');
$image = wp_get_attachment_image_src($images[$key], 'medium');
?>
<article class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="banner">
<div class="brand-img-holder">
<!-- Brand Logos -->
<a href="/product/<?php echo $brand['slug']; ?>/">
<img src="<?php echo $image['0']; ?>" alt="<?php echo $brand['name']; ?>" title="<?php echo $brand['name']; ?>" class="brand-page-img">
</a>
</div>
<div class="brand-img-holder product-holder">
<p>Lorem ipsum dolor sit amet.</p>
</div>
<div class="brand-heading"><a href="/product/<?php echo $brand['slug']; ?>/"><?php echo $brand['name']; ?></a></div>
</div>
</article>
<?php } // End foreach ?>
</div>
</div>
</div>
</section>The page I need help with: [log in to see the link]
- The topic ‘Display Product Images’ is closed to new replies.