Skip to main content
Conditional tags let you execute code only if a certain condition is met. This allows for creating dynamic templates that respond to different states and data.

if

Executes a block of code only if a condition is true.
boolean
The condition to evaluate.

else

Provides an alternative block of code to execute when an if condition is false.

unless

The opposite of if. Executes a block of code only if a condition is false.
boolean
The condition to evaluate.

case

Executes one of many blocks of code, depending on the value of a variable.
any
The variable to evaluate.