Filter by two word tag

I’d like to filter by a tag with two words like so:

        {{#get "posts" limit="all" filter="tag:blue shoes"}}
          {{#foreach posts}}

It doesn’t work and nothing outputs. Can this be done?

tag:... is an expansion for tags.slug in Ghost filtering - docs

Slugs don’t have spaces in them, so I’m guessing you’re trying to use the tag name, which is why you’re not getting any output - you’re trying to find a tag with a slug that doesn’t exist!

Try using filter="tag:blue-shoes" - spaces are converted into hyphens in slugs in Ghost

@vikaspotluri123 wow so I’m certain I tried that multiple times, assuming that the filter was by tag slug, not tag name, and it never worked. And then after your message I tried it again and now it works. Thank you!

1 Like