html - How to get all blogs in Shopify store on any page?
Solution:
Yes, you can access the global variable in Shopify on any homepage, collection, or the product page. Here is the list of global variables (https://www.shopify.com/in/partners/shopify-cheat-sheet) into Shopify
More read about articles (https://shopify.dev/api/liquid/objects?shpxid=0b3b1c6d-11F1-470E-3773-F884AA18D8DD#articles) here.
and use like
{% assign article = articles['news'] %}
{{ article.title | link_to: article.url }}
or use blogs global object to get the articles using the handle.
{% for article in blogs.blog-handle.articles %}
{{- article.title | link_to: article.url }}
{% endfor %}
here blog-handle is your handle slug want to fetch articles.
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.