0

I'm trying to implement jetpack's infinite scroll. my website has ?currency_switch=EUR and ?orderby=width-desc these kinds of custom URL parameters, which are successfully implemented without any ajax and for search I am using relevanssi. I am using this code in my functions.php

function mytheme_infinite_scroll_init() {
    add_theme_support( 'infinite-scroll', array(
        'container' => 'multiple-products',
        'type'           => 'scroll',
        'posts_per_page' => get_option( 'posts_per_page' )

    ) );
}
add_action( 'init', 'mytheme_infinite_scroll_init' );

It works (only at the shop page) but doesn't work with the custom url parameters as mentioned above and breaks for search.I didn't tweak any code for pagination(didn't alter any $paged stc). How to handle it for custom query params? How to deal with relevanssi as it states that it doesn't support the jet pack plugin's infinite scroll feature, is there a way to make relevanssi results infinite scrollable via jet pack.

I tried my custom implementation , as a start tried making a simple ajax call but i am ending up with weird issues like this A simple Ajax call in wordpress doesn't give the expecetd output

Thanks

YeshDev
  • 63
  • 13

1 Answers1

0

Sorry for the boring answer, but there's no way to make Relevanssi work with the Jetpack Infinite Scroll feature. You just need to disable it on search pages, as described in Relevanssi knowledge base.

Mikko Saari
  • 160
  • 1
  • 9
  • Thanks so much for the reply. Right now,i am developing a custom infinte scroll and it works perfectly without relevanssi. With relevanssi, i get irrelevant products in the loop. Here is my question to be precise https://stackoverflow.com/questions/54282847/issuesirrelevant-additional-search-results-in-the-loop-in-applying-custom-infi/54283299#54283299 . Any insights please, in how to tackle it? – YeshDev Jan 25 '19 at 23:47
  • I don't understand how you're using Relevanssi there; I guess the relevant code is hidden inside mytag_restful_search(). – Mikko Saari Jan 26 '19 at 04:15
  • Hi @ Mikko Saar, I deleted my previous comments as they don't describe my problem correctly. There is no problem without infinite scroll but with infinite scroll,i get few irrelevant products after first 20 products.I added the function and edited the description as per that. here is the link again for more detailed description https://stackoverflow.com/questions/54282847/issuesirrelevant-additional-search-results-in-the-loop-in-applying-custom-infi/54283299#54283299. Please give me any insights into how to handle this situation. Thank You – YeshDev Jan 29 '19 at 16:05
  • Sorry, but I don't immediately understand what your code is doing (or even attempting to do), and I can't afford to spend couple of hours figuring it out. – Mikko Saari Jan 30 '19 at 05:28
  • Hi @Mikko, Figured out my issue and really sorry for very lengthy and unreadable code. Thanks again for your help and fast replies. – YeshDev Feb 07 '19 at 22:38