Returning blog posts of specific tag on a page

Excursionist
33 4 1

Hello,

 

I'd like to have a Page in my store contain 2 lists of blog articles based on tag. On the frontend the user would see:

  • Tag1
    • Article1
    • Article2
    • Article3
  • Tag2
    • Article4
    • Article5
    • Article6

Using the following code I get the entire list for Tag2 but Tag1 has some much older posts that are not being displayed. 

      <h2>Tag1</h2>
      {% for article in blogs.news.articles %}
        {% if article.tags contains "Tag1" %}
          {{ article.published_at | date: "%b %d, %Y" }}<br/>
          {{ article.title | link_to: article.url }}<br/>
        {% endif %}
      {% endfor %}
      <h2>TAg2</h2>
      {% for article in blogs.news.articles %}
        {% if article.tags contains "Tag2" %}
          {{ article.published_at | date: "%b %d, %Y" }}<br/>
          {{ article.title | link_to: article.url }}<br/>
        {% endif %}
      {% endfor %}

I've tried filtering by tag but cannot seem to get Tag1 to return all relevant articles, there should be 6 article returning but I only get 1. With Tag2 I get many articles returned. 

 

It feels like it's a pagination issue but when I remove the loop for Tag2 the article count for Tag1 is still 1 article.

 

Guidance would be much appreciated!

You are phoenix
0 Likes