How To: Paginated sorted blog articles?

jao
Excursionist
17 0 3

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?

Replies 8 (8)

KetanKumar
Shopify Partner
36839 3635 11972

@jao 

Thanks for post 

can you please try this code

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

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
jao
Excursionist
17 0 3

Thank you for your reply. 

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

KetanKumar
Shopify Partner
36839 3635 11972

@jao 

need also some custom code

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
jao
Excursionist
17 0 3

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.

 

KetanKumar
Shopify Partner
36839 3635 11972

@jao 

Thanks 

can you please show me error

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
jao
Excursionist
17 0 3

Yes, see first post:

 

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

 
jao
Excursionist
17 0 3

BUMP

serenaBit
Shopify Partner
1 0 0

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