-
Philipp M.
Hey there!
I’m using WP Facet on one of my sites to be able to granularly filter my recipes. WP Facet doesn’t support infinite scroll though, and I can confirm that there are (albeit minor) issues when I use it with the corresponding option under Layout > Blog.
Is it possible to disable infinite scroll for certain pages? I only use WP Facet on the Recipe-Index page and nowhere else, but I would still like to have the infinite scroll feature in archives, search results, etc.
Cheers
Philipp -
Alvind
Hi there,
You can use this snippet:
add_filter('option_generate_blog_settings', function($options) { if (is_page(array(42, 54, 67))) { // Replace with the page IDs $options['infinite_scroll'] = false; $options['infinite_scroll_button'] = false; } return $options; });
Simply replace the numbers inside the array with the page IDs where you want to disable infinite scroll.
Adding PHP: https://docs.generatepress.com/article/adding-php/
-
Philipp M.
Hey Alvind,
sorry for the late reply – your solution works like a charm, thanks!
Cheers
Philipp -
Alvind
You’re welcome!
- You must be logged in to reply to this topic.