I have created a module that displays the three most recent posts on my homepage, however, I have also created a Post banner that displays posts with the tag 'featured' on my homepage.
Basically in the three latest posts (See below) I display the tag of the recent post above the title. I am wanting to display the relevant tag but not display the featured tag.
Currently, to display the tags above the title I am using
{% for tag in post.tag_list %} <a class ="latest-post__blog-tags--tags">{{ tag.name }}</a> {% endfor %}
You can check the value of the tag.name and conditionally print the tag if it's not "featured":
{% for tag in post.tag_list %}
{% if tag.name|lower != 'featured' %}
<a class ="latest-post__blog-tags--tags">{{ tag.name }}</a>
{% endif %}
{% endfor %}
You can check the value of the tag.name and conditionally print the tag if it's not "featured":
{% for tag in post.tag_list %}
{% if tag.name|lower != 'featured' %}
<a class ="latest-post__blog-tags--tags">{{ tag.name }}</a>
{% endif %}
{% endfor %}