Infinite Scroll: query args based on current page
-
I’m looking for a solution to pass different query args for infinite scroll based on the page the user is.
E.G.: If the user is on a search page, post results should be ordered in different order than on other pages.
I’ve tried the infinite_scroll_query_args function:
function jetpack_infinite_scroll_query_args( $args ) { if (is_search()) { $args['order'] = 'DESC'; return $args; } else { $args['order'] = 'ASC'; return $args; } }I guess, that “is_search()” will not work, as it is outside of the loop!? Any idea, how to solve this?
Thanks for your reply in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Infinite Scroll: query args based on current page’ is closed to new replies.