Ghost: Filtering posts by multiple tags

While porting a client's WordPress theme to Ghost, I got stuck trying to filter posts by multiple tags. Here's how to do it.

{{#get "posts" limit="5" filter="tag:runway+tag:-#slideshow"}}

Ghost uses Handlebars as its templating language. Its get helper lets you request a specific number of entries — such as posts and authors — and filter them.

Each filter has two parts: a label and a value. These are separated by a colon. Here's where I got stuck: each filter label can only have one value. As I learned the hard way, tag:runway,-#slideshow won't work.

There's a clue in the documentation, however: multiple filters must be separated by a + (plus sign). Using one tag: label per tag name did the trick.

Subscribe to the Webinista (Not) Weekly

A mix of tech, business, culture, and a smidge of humble bragging. I send it sporadically, but no more than twice per month.

View old newsletters