Replacing blog article display with featured imgs instead

Highlighted
New Member
9 0 0

Hello,

I'm trying to use the blog article widget but I'd like to replace the excerpts with the featured img for each blog post. Here's the code I can't figure out:

{% for article in blogs[settings.blog_widget_select].articles limit: settings.home_page_articles %}
          <div class="four columns">
            {% if article.image.src != blank %}
              {{ article.image.src | img_url: 'medium' }}
              <a href="{{ article.url }}" class="view_product_info" title="{{ article.title | escape }}">{{ 'blogs.general.continue_reading_html' | t }} <span class="icon-right-arrow"></span></a>
            {% else %}
              <p>
                {{ article.content | strip_html | truncatewords: 25 }} 

                <a href="{{ article.url }}" class="view_product_info" title="{{ article.title | escape }}">{{ 'blogs.general.continue_reading_html' | t }} <span class="icon-right-arrow"></span></a>
              </p>
            {% endif %}
          </div>
        {% endfor %}

 

If anyone can give me some tips  - i believe the bold & italicized the part of the code is what will change the excerpt to the featured img. Thanks in advance!

0 Likes