Title: JetPack Infinite Scroll on Search Results Page
Last modified: August 21, 2016

---

# JetPack Infinite Scroll on Search Results Page

 *  [John Wilson](https://wordpress.org/support/users/johnwilsonuk/)
 * (@johnwilsonuk)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/)
 * I’m using JetPack Infinite Scroll on a new theme, and all is well. Except the
   search results page. By default, it didn’t work on the search results page but
   I managed to fix that by using the infinite_scroll_archive_supported filter.
 *     ```
       function wh_infinite_scroll_support() {
       	$supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || is_search() );
       	return $supported;
       }
       add_filter( 'infinite_scroll_archive_supported', 'wh_infinite_scroll_support' );
       ```
   
 * However. When scrolling on to page two, the posts loaded are from the default
   loop as apposed to the second page of results from the search loop. It doesn’t
   appear to be maintaining the search query string. Has anyone seen this before
   and know of a solution?
 * Any help, greatly received.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/page/2/?output_format=md)

 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034874)
 * What happens when you try to switch to another theme, like Twenty Twelve? Do 
   you still experience the issue?
 * That would allow us to know if the problem is caused by Infinite Scroll or by
   the loop in your search template file, maybe.
 * Let me know how it goes!
 *  Thread Starter [John Wilson](https://wordpress.org/support/users/johnwilsonuk/)
 * (@johnwilsonuk)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034876)
 * Yeah, when I add the above filter to Twenty Twelve via functions.php the same
   happens, page 2 shows page two of the main loop not page two of the search results.
 * If I disable this filter & click more posts in Twenty Twelve, it shows the correct
   second page of results.
 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034878)
 * I now recall this Infinite Scroll bug. We’ve been working on a fix in [#1706-plugins](http://plugins.trac.wordpress.org/ticket/1706).
   Could you try to apply [the patch I just uploaded](http://plugins.trac.wordpress.org/attachment/ticket/1706/1706.3.diff)
   to your version of Jetpack?
 * Let me know if it fixes the problem.
 *  Thread Starter [John Wilson](https://wordpress.org/support/users/johnwilsonuk/)
 * (@johnwilsonuk)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034879)
 * Well, I’ve done that. Changed both the infity.php & infinity.js and the same 
   is happening. I tried using both my custom theme & Twenty Twelve and the problem
   persists in both.
 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034884)
 * Thanks for trying! We’re still working on it, so you might want to keep an eye
   on the ticket to follow our progress.
 * I will pot again here as soon as the problem is fixed!
 *  Thread Starter [John Wilson](https://wordpress.org/support/users/johnwilsonuk/)
 * (@johnwilsonuk)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034889)
 * Righto, don’t suppose you know how long it’ll be? I’m sure there’s a million &
   one other things on the list first, but worth a shot 🙂
 * Thanks for trying & looking into it for me.
 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 9 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034892)
 * I don’t have an ETA I’m afraid, but you can add yourself in cc of the ticket 
   I linked to earlier, and you’ll receive an email every time one of us adds a 
   comment, or commits a fix related to that ticket.
 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 8 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4034998)
 * Would you mind trying to replace your version of Jetpack with this one, and let
   me know if it helps?
    [http://i.wpne.ws/QvdB](http://i.wpne.ws/QvdB)
 * Thanks!
 *  Thread Starter [John Wilson](https://wordpress.org/support/users/johnwilsonuk/)
 * (@johnwilsonuk)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035000)
 * We’re getting closer. The More Posts link, when clicked appears to remember the
   search terms however the returned posts don’t appear right, it’s just repeating
   the first 3 posts again then breaks.
 * Also, the infinite scroll only now seems to work on the homepage, it doesn’t 
   work on the taxonomy archives. Now, no longer displaying extra posts.
 * Tried both these with TwentyTwelve too with different results. On the search,
   page two of the infinite scroll returns page 1’s results again, then page 3 shows
   page two’s results and so on.
 * The infinite scroll works on the taxonomy archives just fine.
 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 8 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035014)
 * Thanks for trying again!
 * The patch does work on my test site, so I’m not sure why it doesn’t work on your
   end. Did you make any changes to the Twenty Twelve theme, or do you use other
   plugins that may conflict with Jetpack?
 *  [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [12 years, 8 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035024)
 * Could you also try to use this new version of Jetpack, including another patch?
   
   [http://i.wpne.ws/Qy0a](http://i.wpne.ws/Qy0a)
 * Thanks!
 *  Thread Starter [John Wilson](https://wordpress.org/support/users/johnwilsonuk/)
 * (@johnwilsonuk)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035092)
 * Sorry for the late reply, been away for a couple of weeks. Just downloading &
   trying this now. Will let you know how I get on.
 * Cheers!
 *  [319](https://wordpress.org/support/users/noyz319/)
 * (@noyz319)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035104)
 * Just checking if there have been any updates on this issue? I have the same problem
   and use the same code in my functions.php file. The infinite_scroll_archive_supported
   fix worked for the archives but not for is_search().
 *  [nanoo_k](https://wordpress.org/support/users/nanoo_k/)
 * (@nanoo_k)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035116)
 * I want to try this update as well but I don’t want to muck things up by doing
   it wrong. I already have Jetpack installed, so do I manually upload the individual
   files or can I install these through the WordPress plugin installer?
 *  [nanoo_k](https://wordpress.org/support/users/nanoo_k/)
 * (@nanoo_k)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/#post-4035117)
 * I tried updating my Jetpack, but it looks like I already have the most recent
   version ( v.2.5? ). Then I use this code to activate infinite scroll on search
   pages (it also deactivates infinite scroll in WooCommerce).
 *     ```
       function tweakjp_custom_is_support() {
           $supported = current_theme_supports( 'infinite-scroll' ) && ( is_home() || is_archive() || isset($_GET['site_section']) || is_search() ) && ( !is_woocommerce() );
   
           return $supported;
       }
       add_filter( 'infinite_scroll_archive_supported', 'tweakjp_custom_is_support' );
       ```
   
 * The result is that the home page and archives scroll correctly but the search
   pages still load the homepage posts.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/page/2/?output_format=md)

The topic ‘JetPack Infinite Scroll on Search Results Page’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 16 replies
 * 4 participants
 * Last reply from: [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/jetpack-infinite-scroll-2/page/2/#post-4035118)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
