The Ghost Themes Developer Hub

Welcome to the Ghost Themes developer hub. You'll find comprehensive guides and documentation to help you start working with Ghost Themes as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

plural

{{plural}} Helper - Output a single or plural string based upon some number

Usage: {{plural value empty="" singular="" plural=""}}

Type
Parameters
Attributes

value (number)

  • empty (string)
    • singular (string)
    • plural (string)

Description

{{plural}} is a formatting helper for outputting strings which change depending on whether a number is singular or plural.

The most common use case for the plural helper is outputting information about how many posts there are in total in a collection. For example, themes have access to pagination.total on the homepage, a tag page or an author page.

Examples

{{plural pagination.total empty='No posts' singular='% post' plural='% posts'}}

plural

{{plural}} Helper - Output a single or plural string based upon some number