Skip to content

Instantly share code, notes, and snippets.

View wickcreative's full-sized avatar

Wick Creative wickcreative

View GitHub Profile
@wickcreative
wickcreative / variant-images.liquid
Last active April 14, 2021 19:12
Photo Variant Alt Build
{%- assign option_index = 'option1' -%}
{%- assign image_matrix = '[ ' -%}
{%- assign image_grid__default = '' -%}
{% for option in product.options_with_values %}
{%- assign option_lowercase = option | downcase -%}
{% if option.name == 'color' %}
{% capture option_index %}option{{ forloop.index }}{% endcapture %}
{% break %}
{% endif %}
{% endfor %}
<?php global $post; ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if( $post instanceof SearchWPTermResult ) : ?>
<div class="searchwp-live-search-result">
<p><a href="<?php echo $post->link; ?>">
<?php echo $post->name; ?> (<?php echo $post->taxonomy; ?>) &raquo;
</a></p>
</div>
<?php else : setup_postdata( $post ); ?>