Can I make the Casper theme show all tags (not just one)?

I’m altering the Casper theme to suit my site and i’d like to show every tag on each post instead of just one. I tend to have 3 or 4 tags and i’d like visitors to see all the tags instead of the one that the theme currently shows.
Hoping this is an easy one for someone to answer!

JavaScript way: Ghost has an API for that. Have a look. Get your tags then insert the Dom elements with the results. Sorry I’m on mobile but a quick search would do for their API.

The handlebars way:

Casper uses the {{primary_tag}} helper in post.hbs and partials/post-card.hbs. This helper outputs just the first (aka primary) tag. Replace it with the {{tags}} helper to output all tags.

See for more info.

Examples of different ways of listing tags with this helper can be found on my GitHub page.


Hi - thanks for the help. Unfortunately that didn’t quite work for me. I followed your instructions and it just removed any tags from the post cards and made one tag just repeat twice for each of the posts. If you’re willing to show me how the code should look i’d really appreciate it.

Is it correct that in partials/post-card.hbs you replaced lines 10-13:

{{#if primary_tag}}
  <span class="post-card-tags">{{}}</span>

… with:

{{#if tags}}
  <span class="post-card-tags">{{tags}}</span>

That should work.

Did you double check that there is more than one tag on the post in question?


Thanks - that did work, but now the formatting has gone all weird. I think I might be a bit too limited in my abilities to tackle this stuff. I’d love to communicate directly if you wouldn’t mind helping out (not so keen to post the site itself here).

@mijiemu Sure, send me a DM and I’ll see if I can help.

Thanks - I couldn’t see a way to DM on this forum, but i’ve sent an email to the address on your website.

I have the same problem. When i change the primary_tag to tags then it messes the whole design up. I just want so show two/three tags but one is not enough.

Thx for your help.

{{#foreach tags limit="3"}}
{{name}}{{#unless @last}}, {{/unless}}

This is just an example :slight_smile:



Thx. I had some problems first but now it works perfectly

The space after the comma doesn’t show up though. Using &nbsp; instead worked for me.