<p>Supposing your categories and tags fields are named, respectively, <code>newsCategories</code> and <code>newsTags</code>, you could do the following for the categories:</p>

<pre><code>{% for category in entry.newsCategories %}
    &lt;a href="{{ category.url }}"&gt;{{ category.title }}&lt;/a&gt;
    {% if not loop.last %},{% endif %}
{% endfor %}
</code></pre>

<p>And for the tags:</p>

<pre><code>{% for tag in entry.newsTags %}
    &lt;a href="{{ tag.url }}"&gt;{{ tag.title }}&lt;/a&gt;
    {% if not loop.last %},{% endif %}
{% endfor %}
</code></pre>

<p>This code is untested, but I think this should more or less do what you want to achieve.</p>

CC BY-SA 3.0
2017-05-24T16:13:13.377Z
2017-05-24T16:13:13.377Z
kant312
<p>This is my basic entry layout and I just want to display the linked category and tag names as indicated…</p>

<pre><code>&lt;div class="posts sidemeta"&gt;
{% for entry in craft.entries.section('news').find() %}
&lt;div class="post format-standard"&gt;
    &lt;div class="date-wrapper"&gt;
        &lt;div class="date"&gt;
            &lt;span class="day"&gt;{{ entry.postDate | date("d") }}&lt;/span&gt;
            &lt;span class="month"&gt;{{ entry.postDate | date("M") }}&lt;/span&gt;
        &lt;/div&gt;&lt;!-- /.date --&gt;
    &lt;/div&gt;&lt;!-- /.date-wrapper --&gt;
    &lt;div class="post-content"&gt;
        &lt;h2 class="post-title"&gt;
            &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
        &lt;/h2&gt;
        &lt;ul class="meta"&gt;
            &lt;li class="categories"&gt;Category: &lt;a href="#"&gt;Category Name&lt;/a&gt;&lt;/li&gt;
            &lt;li class="tags"&gt;Tags: &lt;a href="#"&gt;Tag 1&lt;/a&gt;, &lt;a href="#"&gt;Tag 2&lt;/a&gt;, &lt;a href="#"&gt;Tag 3&lt;/a&gt;&lt;/li&gt;
            &lt;li class="share"&gt;&lt;a href="#"&gt;Share&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;&lt;!-- /.meta --&gt;
        {{ entry.body.getPage(1) }}
        &lt;a href="{{ entry.url }}" class="btn"&gt;Read more&lt;/a&gt;
    &lt;/div&gt;&lt;!-- /.post-content --&gt;
&lt;/div&gt;&lt;!-- /.post --&gt;
{% endfor %}
</code></pre>

<p></p>

<templating><entries><categories><tags>
How do I add the Categories and tags related to each entry?
# How do I add the Categories and tags related to each entry?

(Asked by: username_0 on 2017-05-23)

This is my basic entry layout and I just want to display the linked category and tag names as indicated…

{% for entry in craft.entries.section('news').find() %}

    
        
            {{ entry.postDate | date("d") }}
            {{ entry.postDate | date("M") }}
        
    
    
        
            {{ entry.title }}
        
        
            Category: Category Name
            Tags: Tag 1, Tag 2, Tag 3
            Share
        
        {{ entry.body.getPage(1) }}
        Read more
    

{% endfor %}

**Tags:** templating, entries, categories, tags

---

## 1 answers

### Answer by username_1 on 2017-05-24. Score: 1

Supposing your categories and tags fields are named, respectively, newsCategories and newsTags, you could do the following for the categories:
{% for category in entry.newsCategories %}
    {{ category.title }}
    {% if not loop.last %},{% endif %}
{% endfor %}

And for the tags:
{% for tag in entry.newsTags %}
    {{ tag.title }}
    {% if not loop.last %},{% endif %}
{% endfor %}

This code is untested, but I think this should more or less do what you want to achieve.


---

