WordPress.org

Forums

Jetpack by WordPress.com
[resolved] Turn off Infinite Scroll on specific pages (4 posts)

  1. Nate
    Member
    Posted 1 year ago #

    Is it possible to turn Infinite Scroll off for specific post types on their corresponding archive.php pages? If so, how would I go about it? I have looked for a few days now and can't find anything.

    https://wordpress.org/plugins/jetpack/

  2. Brandon Kraft
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    I haven't tested this, but I would start with something like this in your theme's function.php file:

    if ( is_post_type_archive( array( 'foo', 'bar', 'baz' ) ) ) {
    		add_filter( 'infinite_scroll_archive_supported', '__return_false' );
    	}

    where 'foo', 'bar', 'baz' are the post types you do not want supported.

    Cheers!

  3. Nate
    Member
    Posted 1 year ago #

    Actually, that seems to work! The loading animation still appears, but I guess I could change that with CSS. Thanks so much!

  4. Brandon Kraft
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Hope you had a great weekend. CSS to remove the spinner is a great idea. On our end, I'll work to duplicate and correct it since it would make sense for us not to display the spinner in a case like that :-)

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic