I want to hide the latest post from the blog loop - so the first post it shows is the second most recent. Editing in .liquid.
{% for article in blog.articles %}
{% assign article_content = article.excerpt_or_content %}
{% assign featured_image_src='' %}
{% if article.image %}
{% assign featured_image_src=article | img_url: '1024x1024' %}
{% elsif article_content contains '
{% endfor %}
Javitoo
2
Try adding a counter and condition to skip the first post:
{% assign post_count = 0 %}
{% for article in blog.articles %}
{% if post_count > 0 %}
{% assign article_content = article.excerpt_or_content %}
{% assign featured_image_src='' %}
{% if article.image %}
{% assign featured_image_src=article | img_url: '1024x1024' %}
{% elsif article_content contains '
{% endif %}
{% assign post_count = post_count | plus: 1 %}
{% endfor %}
This should give you exactly what you’re looking for. The counter will skip the first post while maintaining all your current styling.
Guleria
3
Hello @maslerdanch ,
Try this
{% assign post_count = 0 %}
{% for article in blog.articles offset: 1 %}
{% if post_count > 0 %}
{% assign article_content = article.excerpt_or_content %}
{% assign featured_image_src='' %}
{% if article.image %}
{% assign featured_image_src=article | img_url: '1024x1024' %}
{% elsif article_content contains '
{% endif %}
{% assign post_count = post_count | plus: 1 %}
{% endfor %}
Regards
Guleria
Thank you - I see what I was doing wrong.