I’m trying to show a list of posts with the tag “Popular” (which is not the first tag) and on this list I want it to show the primary tag of the post. If I use {{reading_time}}
in the same context it works, but not with {{primary_tag.name}}
. Why am I unable to grab the primary tag for the post in this context? It works in other contexts.
<div class="col-2">
{{#get "posts" filter="tags:popular+featured:false" limit="5" }}
<h2 class="section-title" style="margin-left: 0;">Popular <a href="/blog/tag/updates/" class="section-all">SEE ALL</a>
</h2>
<div class="popular-posts-block">
{{#foreach posts}}
<div class="popular-post-line row" onClick="window.location.href = '{{url}}';">
<div class="col-3-mob popular-post-image">
<a href="{{url}}">
<img class="popular-post-image"
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(max-width: 1000px) 400px, 700px"
src="{{img_url feature_image size="m"}}"
alt="{{title}}"
/>
</a>
</div>
<div class="post-card-content">
<a class="post-card-content-link popular-post-content-link" href="{{url}}">
<header class="post-card-header">
<p class="post-card-title popular-post-title">{{title}}</p>
</header>
</a>
</div>
<div class="popular-posts-tags col-3-mob">
<span class="popular-posts-tags"><b class="post-card-tag-name">{{primary_tag.name}}</b>
</div>
</div>
{{/foreach}}
</div>
{{/get}}
</div>