How to fix {{#foreach}} warning in Ghost v4?

I update to the Ghost v4, but there are many warnings about the theme.

The default visibility for posts in {{#foreach}} block helper has changed in v4.

I read the document, it says that " The default visibility for posts in {{#foreach}} block helper has changed from public to all in Ghost v4.Find more information about the {{foreach}} helper". But I still confuse how to fix it.

In my theme, it has a lot of {{#foreach}} like this:

{{#foreach posts}}

How can I fix this warning?

Make sure to update both Ghost and API versions in the package.json file to v4.

"engines": {
  "ghost": ">=4.0.0",
  "ghost-api": "v4"
}

Greate! Warning disappear! Thanks a lot~ :+1:t2: :tada:

1 Like