• Hi All,

    I am trying to use YITH Infinite Scrolling on a site. However, on search results page and category page, items that have been already shown keeps duplicating on each load. For example, if a search result page show 10 items (numbered 1-10) at first, then when one scrolls down, 1-10 is loaded again in addition to 11-20 and so on. After loading the last item, further scrolling keeps triggering the plugin to load everything. The page template does NOT use WP query so there is no place to modify or add attributes. It has a loop like this:

    while ( have_posts() ) : the_post();
    get_template_part( $template_part, get_post_format() );
    endwhile;

    (div for single post item is within the template_part)

    How do I get the infinite scroll to load properly?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Andrea Grillo

    (@agengineering)

    Hi there,

    could you share the webiste url where I can experiencing this issue and a screenshot with the Infinite Scrolling configuration, please?

    Thread Starter achanne

    (@achanne)

    Hello, I have found the problem with the first issue: there were no classes or ID’s to distinguish “previous” from “next” page links, so for the NEXT selector, I added “a:last-of-type”. But I still have the problem with non-stop scrolling after reaching the last page. Is there a way to stop it after getting to the last post?

    An example of a page with YITH infinite scrolling:
    https://clubfoody.com/category/beef/

    I don’t know how to attach an image to this reply but here are my configurations:
    Navigation Selector: .pagination-w.hide-for-isotope
    Next Selector: .pagination-w.hide-for-isotope a:last-of-type
    Item Selector: .item-isotope
    Content Selector: .index-isotope
    Loading Image: https://clubfoody.com/wp-content/themes/pluto-osetin-theme-child/assets/images/ajax-loaders/loader-light-blue-more-recipes.gif

    Thanks.

    Plugin Support Leanza Francesco

    (@leanzafrancesco)

    Hi,

    your loop should show the correct pagination links, by adding the “next” anchor only if the “next” page is available.
    To achieve that, you could use, for example, the the_posts_pagination function to leave WordPress print the pagination links: this way you’ll have the pagination links with the correct CSS classes and you’ll be able to use them in the YITH Infinite Scrolling settings.

    Please try this solution and let us know if everything works fine!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Repeating Content Infinitely on Search and Category Template’ is closed to new replies.