# How do I show multiple tags on post pages

**URL:** <https://forum.ghost.org/t/how-do-i-show-multiple-tags-on-post-pages/47646>\
**Category:** Developer help\
**Created:** [May 25, 2024, 9:35am UTC](https://forum.ghost.org/t/how-do-i-show-multiple-tags-on-post-pages/47646 "2024-05-25T09:35:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JayTelford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jaytelford/32/30505_2.png) [@JayTelford](https://forum.ghost.org/u/JayTelford)\
**Post date:** [May 25, 2024, 9:35am UTC](https://forum.ghost.org/t/how-do-i-show-multiple-tags-on-post-pages/47646/1 "2024-05-25T09:35:36Z")

</div>

Hi,

Using the official _ **Source** _ theme (v1.2.2) on a self hosted ghost instance – I am trying to get the first two tags of each post to show up on post pages, not just the primary tag.

I have seen where the tags get displayed on the posts pages by looking in _post.hbs_ but I am not sure how to modify it.

This is what currently shows:

```auto

...

        <header class="gh-article-header gh-canvas">

            {{#if primary_tag}}
                <a class="gh-article-tag" href="{{primary_tag.url}}">{{primary_tag.name}}</a>
            {{/if}}
...

```

  

What I am looking for however, is to show the first _ **two** _ tags, not just the primary one.

I am sorry for having to ask such a simple question, but I am new to Ghost theming, and I am starting off by just modifying one of the official themes.

I have read a lot of stuff online, about replacing the code above with custom code that shows all tags, but that’s not what I want – as my posts often have 4 or 5 tags, I only want to show the primary and secondary ones and nothing I have seen thus far tells me how to only display first two.

Hopefully, some of you would be able to help me with this.

Thanks

😃

Jay

* * *

Here are my system details.

* * *

**System Details:**

I am self hosting ghost on a private VPS. My site is accessible via [www.jaytelford.me](http://www.jaytelford.me).

- **Ghost Version** : 5.82.11
- **Environment** : production
- **Node** : v18.20.2
- **Database** : mysql8 – 8.0.36-2

VPS Details:

- **OS** : Ubuntu 24.04 LTS
- **Kernel** : GNU/Linux 6.8.0-31-generic x86\_64

---

<div class="post-metadata">

**Author:** ![AnimaVillis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/animavillis/32/27600_2.png) [@AnimaVillis](https://forum.ghost.org/u/AnimaVillis)\
**Post date:** [May 25, 2024, 9:40am UTC](https://forum.ghost.org/t/how-do-i-show-multiple-tags-on-post-pages/47646/2 "2024-05-25T09:40:48Z")

</div>

Try read this topic:

> [@Solo theme: show multiple tags](https://forum.ghost.org/t/solo-theme-show-multiple-tags/44418/4):
>
> Hello! In this case you need to download Your theme. Then edit file loop.hbs Then add under this lane: \<h2 class="gh-card-title"\>{{title}}\</h2\> Somethink like that: {{#if tags}} {{#foreach tags}} \<a href="{{url}}" title="{{name}}"\>{{name}}\</a\> {{/foreach}} {{/if}} That’s give you tags under title, remember that you need to style it! slight_smile Then you need to edit post.hbs like @Cathy_Sarisky said and find: {{#if primary\_tag}} \<a class="gh-article-tag" href="{{prima…

---

<div class="post-metadata">

**Author:** ![joe-blocher](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joe-blocher/32/27872_2.png) [@joe-blocher](https://forum.ghost.org/u/joe-blocher)\
**Post date:** [May 30, 2024, 3:35am UTC](https://forum.ghost.org/t/how-do-i-show-multiple-tags-on-post-pages/47646/3 "2024-05-30T03:35:13Z")

</div>

Look at [Theme Helper Tags](https://ghost.org/docs/themes/helpers/tags)  
You can set  
{{tags limit="2“}}  
or other like  
{{tags from=“2”}}

---

<div class="post-metadata">

**Author:** ![JayTelford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jaytelford/32/30505_2.png) [@JayTelford](https://forum.ghost.org/u/JayTelford)\
**Post date:** [June 9, 2024, 12:37pm UTC](https://forum.ghost.org/t/how-do-i-show-multiple-tags-on-post-pages/47646/4 "2024-06-09T12:37:58Z")

</div>

Hi,

Thanks for your reply. Using your reply and the link you gave me to the docs, I have managed to get my tags looking like this:

 ![Screenshot 2024-06-09 at 13.22.10](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/f/a/fa24a4a1a0440ce8af4d4ef5d58e89eccbfd8c0f.png)  
  

To accomplish the above I used the following in `post.hbs`

```auto

...

    <article class="gh-article {{post_class}}">

        <header class="gh-article-header gh-canvas">

            <div class="post-meta tags-container">
                {{#if tags}} {{#foreach tags limit=" 2" }} <a href="{{url}}" class="gh-article-tag">
                    {{name}}</a>{{#unless @last}}<span class="tag-separator"> | </span>{{/unless}}
                {{/foreach}}
                {{/if}}
            </div>
...

```

  

In combination with the following CSS

```css
...

/* CUSTOM STYLES */

/* Add some space between the tags and the title */
.tags-container {
    margin-top: 10px;
    /* Adjust the value as needed */
    margin-bottom: 20px;
    /* Add space beneath the tag container */
}

.gh-article-tag {
    text-decoration: none;
    /* Remove underline */
}

.gh-article-tag:hover {
    text-decoration: none;
    /* Ensure underline is not added on hover */
}

.tag-separator {
    margin: 0 5px;
    /* Apply left and right margins to the separator */
}

```

  
Which I have added to the bottom of the screen.css file.

So that works now.

:)

Jay
