How can I create a paginated, time-sorted list of blog articles?

I’m trying to create a paginated list with blog articles that are sorted by time of update.

Liquid error (sections/blog-template.liquid line 72): Array ‘blog_posts_sorted’ is not paginateable.

This is the relevant liquid code:

{% assign blog_posts_sorted = blog.articles | sort: “updated_at” %}

{%- paginate blog_posts_sorted | sort: “updated_at” by articles_per_page -%}

How do I paginate a sorted list of blog articles?

@jao

Thanks for post

can you please try this code

https://www.shopify.in/partners/blog/shopify-pagination

Thank you for your reply.

I don’t see how the code in that article solves the sorting problem.

@jao

need also some custom code

Yes I understand and my question is, what kind of custom code should I be using because the docs don’t provide any real information.

I appreciate you’re trying to help but I hope you understand that “need some custom code” is not helpful. I already came to that conclusion and I tried custom code that didn’t work but returned an error and now I’m trying to find out what the error means and how to solve it so I can have a sorted paginated list of blog posts.

@jao

Thanks

can you please show me error

Yes, see first post:

Liquid error (sections/blog-template.liquid line 72): Array ‘blog_posts_sorted’ is not paginateable.

BUMP

Getting the same error, did someone found a solution for this?