I have previous/next links setup with my theme that use the primary tag. eg:
{{#next_post in="primary_tag"}}
However, I want to filter this further using by looking for posts that include an additional tag “top-10”. I’ve tried a few approaches but I can’t seem to get it working.
Any help would be hugely appreciated.
Here is the full code I’m working with:
<aside class="section-prev-next">
<div class="prev-next-wrap">
{{#next_post in="primary_tag"}}
<a href="{{url}}" class="prev-post {{post_class}} {{#if feature_image}}is-image{{/if}}">
{{#if feature_image}}
<div class="prev-next-image" style="background-image: url({{feature_image}})"></div>
{{/if}}
<section class="prev-next-title">
<h5>{{t "Newer Post"}}</h5>
<h3>{{title}}</h3>
</section>
</a>
{{/next_post}}
{{#prev_post in="primary_tag"}}
<a href="{{url}}" class="next-post {{post_class}} {{#if feature_image}}is-image{{/if}}">
{{#if feature_image}}
<div class="prev-next-image" style="background-image: url({{feature_image}})"></div>
{{/if}}
<section class="prev-next-title">
<h5>{{t "Older Post"}}</h5>
<h3>{{title}}</h3>
</section>
</a>
{{/prev_post}}
</div>
</aside>