1

I'm currently trying to develop my wordpress store using wordpress and woocommerce and I've run into a problem I can't seem to find the answer.

So i have added a attribute called 'images' on all my products which shows a link to an external url as seen in the screenshot, is there somehow I can grab this url and put it into my code? Example <img src="ATTRIBUTE IMAGES LINK HERE" /> so i can display this image on the products page? I've look around but I'm not the best with php so was hoping someone here might be able to help me.

1

PredragDj
  • 313
  • 1
  • 3
  • 10
UrbaN
  • 13
  • 2

1 Answers1

1
<img src="<?php echo esc_attr($product->get_attribute('images')) ?>">

Should do the trick.

You may have to add

global $product;

before, if it's not there already.

Zoli Szabó
  • 4,366
  • 1
  • 13
  • 19