How to Display a List of Tags in Your Ghost Blog

by
Nistor Cristian 2
in
Tutorials

Sometimes you want to display a list of tags in your Ghost theme. There are multiple ways to do this. Let's try with get helper:

{{#get "tags" limit="all"}}
    <ul class="tags">
        {{#foreach tags}}
            <li>
                <a href="{{url}}">{{name}}</a>
            </li>
        {{/foreach}}
    </ul>
{{/get}}

This will fetch all tags in your blog and loop through the data. It will create an unordered list, in each list item will be an anchor that is linked to the tag url.

Another way to get all tags and show them is:

{{#get "tags" limit="all"}}
	{{tags}}
{{/get}}

This way we are going to use the tags helper and output a linked list of tags.

We can also use jQury and Ghost API to get all the tags.

$.get(ghost.url.api('tags', {limit: "all"})).done(function (data){
    console.log(data.tags);
});

There are a lot of combinations that you can do with tags. Read more about tags helper, get helper or tags endpoint to create your desired list of tags for your Ghost blog.

Get a quote

Get in touch with us and we will create a custom Ghost theme that fits your branding.

close modal
Submit