显示与特定标签的相关博客文章,博客包含的内容 - shopify

发布于 2025-02-08 19:36:19 字数 779 浏览 2 评论 0原文

显示博客文章具有博客拥有的特定标签 - 例如Shopify

,例如,如果博客包含标签素食主义者,并且需要显示包含标签素食主义者的相关博客,

如果博客的标签是标签是带有鸡蛋标签的鸡蛋秀与鸡蛋标签相关的博客。

现在,我的代码现在显示了网站上所有博客的相关博客,即使标签不匹配或不适用该博客。这是带有标签的博客tinyurl.com/294769GB

<div class="wrapper">
<h4 style="margin-left: 1%;">Related Recipes</h4>
<div class="res">
{% for article in blogs.Recipes.articles limit:8 %}
{% if article.tags contains 'Vegan' %}
<div class="njohn_search_otherpage"> 
<a href="{{ article.url }}" title="{{ article.title | escape }}"> 
<div class="crop">{{ article.image.src | img_url: 'medium' | img_tag: article.title }}</div> 
<div>{{ article.title }}</div> </a> </div>
 {% endif %} 
 {% endfor %}
  </div>  
</div>

Display blog posts with a specific tag that blogs have - Shopify

For example, if the blog contains the tag Vegan, and needs to show related blogs that contain the tag Vegan,

if the blog has the tag is egg show related blogs with egg tag.

now my code now shows the same related blogs for all the blogs on the website, even if the tag doesn't match or is not applied to that blog. here is the blog with tags tinyurl.com/294769gb

<div class="wrapper">
<h4 style="margin-left: 1%;">Related Recipes</h4>
<div class="res">
{% for article in blogs.Recipes.articles limit:8 %}
{% if article.tags contains 'Vegan' %}
<div class="njohn_search_otherpage"> 
<a href="{{ article.url }}" title="{{ article.title | escape }}"> 
<div class="crop">{{ article.image.src | img_url: 'medium' | img_tag: article.title }}</div> 
<div>{{ article.title }}</div> </a> </div>
 {% endif %} 
 {% endfor %}
  </div>  
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文