Infinite Scroll – is_where_am_i()
-
Dear Rocketeers,
I’ve been trying to use the Infinite Scroll module for the first time and must say that I’m quite impressed.
I’ve been pulling my hair out over a little problem I’m having and hope you have some advice.
I’ve discovered the wonderful ‘infinite_scroll_query_args’ filter for doing wonderful stuff like adding [‘offset’], [‘posts_per_page’], [‘post__not_in’]… wünderbar!
However, I can’t seem to figure out how to use conditionals within the filter. Whether I’m on the homepage (reading->show blog posts on homepage) or in a category archive,
is_home() and is_front_page() always return true
is_archive() and is_category() always return false.To be more precise: I’m trying to set different [‘posts_per_page’] based on is_home() or is_archive().
On is_archive(), I’d like to add an offset based on a number of posts in a setting (that dictates a separate query for a header section).
On is_home(), I’d like to add a [‘post__not_in’] based on manually selected posts in another section (array).…but I can’t seem to figure out how to call these conditionals through ‘infinite_scroll_query_args’ filter. :'(
Any advice would be greatly appreciated.
Thank you for your time,
Michal Bluma
- The topic ‘Infinite Scroll – is_where_am_i()’ is closed to new replies.