Dear all,
Firstly I’m using non-shopify theme, and I managed to set different products image for different products like following:
file: [theme.liquid]
<meta property=“og:image” itemprop=“image” content={{ product.featured_image.src | img_url: ‘600x600’ }}>
But some pages like collections/AAA and collections/BBB don’t have product.featured_image.src, how can I keep showing products image for products pages, while showing other images for collections/AAA and collections/BBB?
I tried something like following but not working:
{% if page_title == ‘AAA’ %}
<meta property=“og:image” itemprop=“image” content=“https://cdn.shopify.com/s/files/xxx.jpg”
{% endif %}
{% if page.url == ‘collections/AAA’ %}
<meta property=“og:image” itemprop=“image” content=“https://cdn.shopify.com/s/files/xxx.jpg”
{% endif %}
Thanks