How To Show Featured Image First In Featured Product in Home Page Instead Of First Selected Variant

Topic summary

Issue: On Dawn theme, the homepage Featured Product section shows the first selected variant image by default instead of the product’s featured (main) image. The product page fix from another thread works there but not on the homepage.

Attempts and suggestions:

  • Code tweak in sections/featured-product.liquid to loop product.media with an offset showed the second image, not the featured image, which didn’t meet the requirement.
  • Variant selection logic change in snippets/product-variant-options.liquid: commenting out or conditionally disabling the “checked” state for the selected variant (applies to button/pill variants, not dropdown). A homepage-only version using {% unless template.name == “index” %} was provided.

Current result: After reverting and trying the homepage-only variant “checked” change on a fresh theme copy, the homepage still shows the first variant image, not the featured image.

Context/notes:

  • Store access briefly password-protected; later removed for testing.
  • A screenshot was referenced to illustrate desired behavior.

Status: Unresolved. The latest guidance did not correct the homepage Featured Product image behavior; further troubleshooting or an alternative code approach is needed to ensure the featured image displays by default and switches only upon variant selection.

Summarized with AI on January 17. AI used: gpt-5.

Hello,

I want to always show the featured product instead of the first variant image in the latest dawn theme version. I followed the below link and it works perfectly.

Solved: Show Featured Product Image Instead of Selected Variant Image, Dawn Theme, v8.0.0 - Shopify Community

However, it works well in the products pages but does not work for a featured product I had added on my homepage. Since the location is different I have to code it separately in card-product.liquid but I don’t know how to code. Any help?

Thanks.

Could you please provide the URL and password for website?

Hello Nadia,

www.seby-store.com

Not password protected..

1 Like

Try this… Navigate to Online Store > Themes > “…” > Edit Code. Find the “featured-product.liquid” file in the sections folder. Scroll down to around line 79 and find this chunk of code.


 {% render 'product-thumbnail',
      media: media,
      position: 'featured',
      loop: section.settings.enable_video_looping,
      modal_id: section.id,
      xr_button: false,
      media_width: media_width,
      media_fit: section.settings.media_fit,
      constrain_to_viewport: section.settings.constrain_to_viewport
 %}

Replace with:


  {%- for media in product.media limit: 1 offset: 1 -%}
   {% render 'product-thumbnail',
       media: media,
       position: 'featured',
       loop: section.settings.enable_video_looping,
       modal_id: section.id,
       xr_button: false,
       media_width: media_width,
       media_fit: section.settings.media_fit,
       constrain_to_viewport: section.settings.constrain_to_viewport
    %}
  {%- endfor -%}

What it’s doing is looping through the images, offsetting the featured image to the second one in the loop and then limiting it to only show one featured image at a time. Here is an example: https://nadia-coalition-tech.myshopify.com/ PW: teatime. When you view full product, you’ll notice it’s pulling in the second image only for the featured product section on the homepage.

Hope this helps!

Hello Nadia,

Thank you for your reply.

I tried your code but now it’s giving me the second variant picture (Yellow product).

What I want is to show the product featured main picture first which I chose here on the left.. and then when I choose the color Blue or Yellow to see the selected variant picture..

Hello Nadia,

Any feedback?

Hi, thanks for your patience. The store is now password protected. Could you please provide me with the password so I can take another look?

Hello Nadia,

Password removed.

Thanks.

I see. Okay, feel free to reverse/undo the other code. Note that the following applies to the button/pill variant type only, not the drop down. Navigate to Online Store > Themes > “…” > Edit Code. Open the snippet file titled “product-variant-options.liquid”. Around line 55, you’ll find this:

{% if option.selected_value == value %}
    checked
{% endif %}

To make the change globally (main/all products not just the featured product) you’ll replace that block of code with this:

{% comment %}
{% if option.selected_value == value %}
    checked
{% endif %}
{% endcomment %}

To apply this change ONLY to the featured product on the homepage, keeping the main product the same, you’ll replace it with this:

{% if option.selected_value == value %}
  {% unless template.name == "index" %}
    checked
  {% endunless %}
{% endif %}

Example of homepage only: https://nadia-coalition-tech.myshopify.com/

PW: teatime

Please let me know how this solution works for you.

Hello Nadia,

Thank you for your reply. Unfortunately, this did not work.

Hi, could you please explain an issues you encountered? Please remember to revert changes first before moving on.

Let’s try again and start with JUST the featured product on the homepage… Navigate to Online Store > Themes > “…” > Edit Code. Open the snippet file titled “product-variant-options.liquid”. Around line 55, you’ll find this:

{% if option.selected_value == value %}
    checked
{% endif %}

Replace with:

{% if option.selected_value == value %}
  {% unless template.name == "index" %}
    checked
  {% endunless %}
{% endif %}

Working example with same theme: https://nadia-coalition-tech.myshopify.com/

Hello Nadia,

I am starting from a copy of my theme no changes are made to the code yet.. followed the steps above but the first variant picture is still showing.. I want the main picture instead..