How can I implement a delay function in liquid?

For everyone coming across this issue: there is not a way to implement sleeping or delaying in liquid.

If you intend to add a delay to any part of your code, you must use Javascript, preferably with the use of asynchronous functions (like shared in the previous comment) instead of callbacks (e.g. setTimeout).

Naturally having experience coding with Javascript is crucial for this. Unfortunately this is not something that can be implemented with step-by-step guidance, each theme will require a different approach, and, depending of one’s theme, some parts will need to be restructured to be able to fit a delay.

If you’re not comfortable with Javascript you’ll want to contact a developer to implement this functionality.

Kind regards,
Diego