Get blog posts in liquid template

Highlighted
New Member
4 0 0

Hi

How can I get blog posts in liquid template without fetching from category like "news"? I want to display all latest blog posts limited to 10 or 15 (of whatever I want). 

Now I have to query from specific category but I don't want to query from specific category.

 

{% assign category = 'news' %}
{% unless blogs[category].empty? or blogs[category].articles.size == 0 %}
     {% for article in blogs[category].articles %}
         {{ article.title }}
     {% endfor %}
{% endunless %}

And how can I get a list of all blog categories? 

0 Likes
Explorer
102 9 9

Hi @Mahmud-Sabuj,
If you want to list all articles in blogs (15 max) use this code:

{% for article in blogs.articles limit:15 %}
    {{ article.title }}
{% endfor %}

 

Let's make the best store!
Contact us at: thepremierstores@gmail.com
1 Like
New Member
4 0 0

Not working in dynamic section at sections/blogSection.liquid

0 Likes