Jetpack Infinite Scroll Breaks Sort Order
-
On my taxonomy pages I like to sort posts into alphabetical order. However, Jetpack seems intent on using the actual order of elements in the query array regardless of my sorting. I have the following in my
functions.php
file:add_action( 'pre_get_posts', 'modify_taxonomy_sort_order' ); function modify_taxonomy_sort_order( $query ) { if ( $query->is_tax() && $query->is_main_query() ) { $query->set( 'posts_per_page', '-1' ); $query->set( 'orderby', 'title' ); $query->set( 'order', 'asc' ); } }
Before enabling infinite scroll, this worked fine. After enabling infinite scroll, the posts come out unsorted.
I would be happy enough just disabling infinite scroll on the pages that use this sorting (since I ask for them all anyway with the ‘-1’), but I know of no way to do this.
I do know that this function is being called and the
if
statement is being evaluated as true.Any thoughts on how to get the sort order working or disable infinite scroll on certain pages?
- The topic ‘Jetpack Infinite Scroll Breaks Sort Order’ is closed to new replies.