Are you an LLM? You can read better optimized documentation at /themes/tags/continue.md for this page in Markdown format
continue
With continue you skip the current loop iteration and go to the next one.
INFO
The continue command can only be placed inside the body of for tag.
Example:
Data
json
{
"products": [
{
"slug": "product-1",
"price": 76
},
{
"slug": "YouCan",
"price": 100
},
{
"slug": "product-2",
"price": 30
},
{
"slug": "product-3",
"price": 124
},
]
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Note: Data is only refereed as a reference for this example and is in no means reflecting real world data.
liquid
{% for product in products %}
{% if product.price > 80 %}
{% continue %}
{%- else -%}
{{- product.slug -}} | {{- product.price -}}
{%- endif -%}
{% endfor %}1
2
3
4
5
6
7
2
3
4
5
6
7
Output
html
product-1 | 76
product-2 | 301
2
2