Liquid: Where "Category" Filter Except Certain Categories


#1

This is probably an easy solution. On my index page, I’m wanting to show all posts except a “Preview” and “Featured” category. I am only seeing where the where filter is additive, not subtractive.

Here is the for loop currently:

<div class="cf frame">
  {% for post in paginator.posts %}
    <article class="post" itemscope itemtype="http://schema.org/BlogPosting" role="article">
      <div class="article-item">
        <header class="post-header">
          <h2 class="post-title" itemprop="name"><a href="{{ post.url }}" itemprop="url">{{ post.title }}</a></h2>
        </header>
        <section class="post-excerpt" itemprop="description">
          <p>{{ post.content | split:'<!-- break -->' | first | strip_html }}</p>
		  <a href="{{ post.url }}" itemprop="url">Continue reading...</a><br><br>
        </section>			
      </div>
    </article>
  {% endfor %}
</div>

Thanks in advance for any help!
Ryan


#2

Because you’re using paginator.posts via jekyll-paginate I think your options might be limited as its been deprecated.

There’s are these threads asking for what I believe you want, but they’ve been closed.

jekyll-paginate-v2 picks up where the official paginate plugin left off, with many features like paginating collections, categories, etc. Doesn’t look like it has the exclude feature you want just yet.


#3

Ok gotcha, thanks for the info.

Looks like I can accomplish what I was looking to do with the “hidden: true” tag, really. Which was basically just wanting to have posts that are publicly available but don’t show up in my main feed.

Thanks again!