简体   繁体   English

Shopify调用博客中除第一篇文章外的所有文章

[英]Shopify call all articles in blog EXCEPT the first one

I am building a fancy blog page for my client. 我正在为我的客户建立一个精美的博客页面。 They want the first blog post shown full width with a bunch of other cool things showing, then they want the other posts displayed below in order they came out. 他们希望第一篇博客文章显示为全角,并显示许多其他有趣的东西,然后他们希望下面显示其他文章以便它们出来。

I have the fancy part worked out, but when I put the rest of the blog posts below that one, the first one still comes up. 我想出了花哨的部分,但是当我将其余博客文章放在该文章下面时,第一个仍然出现。

Logically this makes sense because I am using {% for article in blog.articles %} to call the posts, but is there any way I can skip just the first post when calling all the other posts for the blog? 从逻辑上讲,这是有道理的,因为我使用{% for article in blog.articles %}中的文章,但是调用博客的所有其他文章时有什么方法可以跳过第一篇文章?

Thanks! 谢谢!

Shopify have an offset filter. Shopify具有偏移过滤器。

You can read more on it here: https://help.shopify.com/themes/liquid/tags/iteration-tags#offset 您可以在这里阅读更多信息: https : //help.shopify.com/themes/liquid/tags/iteration-tags#offset

To sum it up your code will become {% for article in blog.articles offset: 1 %} 总结起来,您的代码将成为{% for article in blog.articles offset: 1 %}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM