# Shows all posts instead of from specific category

**URL:** <https://talk.jekyllrb.com/t/shows-all-posts-instead-of-from-specific-category/8493>\
**Category:** Help\
**Created:** [August 25, 2023, 9:38am UTC](https://talk.jekyllrb.com/t/shows-all-posts-instead-of-from-specific-category/8493 "2023-08-25T09:38:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dl-tg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dl-tg/32/5494_2.png) [@dl-tg](https://talk.jekyllrb.com/u/dl-tg)\
**Post date:** [August 25, 2023, 9:38am UTC](https://talk.jekyllrb.com/t/shows-all-posts-instead-of-from-specific-category/8493/1 "2023-08-25T09:38:04Z")

</div>

```auto
<h2 class="category-name">Категорія: Війна</h2>
{% for post in site.categories.war %}
  {% include posts.html %}
{% endfor %}

```

posts.html:

```auto
<div class="post-list">
    {% for post in paginator.posts %}
      <div class="post">
        <h2 class="post-title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
        {% include post-date.html %}
        <p class="post-meta">Категорія: {{ post.categoryalias }}</p>
        <img class="post-thumbnail" src="{{ post.thumbnail }}">
        <p class="post-meta">{{ post.excerpt }}</p>
        <a href="{{ post.url }}" class="post-readmore">Читати далі</a>
      </div>
    {% endfor %}
  </div>
  
  {% if paginator.total_pages > 1 %}
  <ul>
    {% if paginator.previous_page %}
    <li>
      <a href="{{ paginator.previous_page_path | prepend: site.baseurl }}">Наступна сторінка →</a>
    </li>
    {% endif %}
    {% if paginator.next_page %}
    <li>
      <a href="{{ paginator.next_page_path | prepend: site.baseurl }}">← Попередня сторінка</a>
    </li>
    {% endif %}
  </ul>
  {% endif %}

```

I’ve done everything and it still renders all posts…  
I set categories like categories: [smthng] in the front matter if anything.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 25, 2023, 3:14pm UTC](https://talk.jekyllrb.com/t/shows-all-posts-instead-of-from-specific-category/8493/2 "2023-08-25T15:14:55Z")

</div>

are you using [jekyll-paginate-v2](https://github.com/sverrirs/jekyll-paginate-v2)? it should support category pagination but the original one does not.

---

<div class="post-metadata">

**Author:** ![dl-tg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dl-tg/32/5494_2.png) [@dl-tg](https://talk.jekyllrb.com/u/dl-tg)\
**Post date:** [August 27, 2023, 10:01pm UTC](https://talk.jekyllrb.com/t/shows-all-posts-instead-of-from-specific-category/8493/3 "2023-08-27T22:01:46Z")

</div>

Yes I do use that plugin

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 27, 2023, 10:38pm UTC](https://talk.jekyllrb.com/t/shows-all-posts-instead-of-from-specific-category/8493/4 "2023-08-27T22:38:01Z")

</div>

I don’t use pagination so I will be of limited help - but your initial problem is that on the top code section you are checking the category, but then you are including the posts.html file which is just taking all the posts. You need to do the category in the posts.html file also.

If you are re-using the posts.html file maybe make a duplicate of it? or you can pass a parameter in with it I think and then use that in the posts.html to filter by the category.

I’m guessing the plugins docs have examples that should get you fixed up.
