Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Filtering out categories in paginator.posts #2018
Currently there doesn't seem to be a way to filter out any post that is in a category. I'm trying to have a separate list of posts that doesn't affect the main posts index in the slightest, but it seems there is no way to do it.
I can get close with this:
The goal of that code is to get a list of posts (config says 10 posts per page), but don't include any of the posts that are in the resources category. However, it falls short in that it will find 10 posts, then filter out the ones in the resources category, leaving me with fewer than 10 posts on the generated page.
What I'd love to be able to do is one of two things:
Is that too far out of left field for this? Does it makes sense what I'm trying to do?
Hey @mdo! Thanks for filing the issue.
Could you clarify, please? What do you envision for this?
It sounds like you want the inverse of the
The struggle here is pre-filtering the
I too would love see to see this feature. I'm struggling to move from Joomla for this very reason.
I kind of expected the Paginator to just pick up posts in a single directory hierarchy (off the root) - so if I had /blog/_posts and /poems/_posts then the Paginator would process them independently. It sounds like the filtering above would be more flexible - and would allow this type of behavior.
I'd also like to see this feature.
I was recently trying to figure out how to get the "Next" and "Previous" page links (for the permalink pages ... i.e., the "full post" view) to skip posts.
For my silly blog, I've got some posts that are marked as "external", so when clicked, they go to the external website; when page between full story pages, I couldn't figure out a way to paginate between all posts except a specific category (or tag, or custom front matter key).
It would be rad to have the ability to say "paginate between X and ignore Y" without losing items, like stated in the first post here:
Anyway, +1 from me. I just wish I had the über skill to contribute to this issue.