Forums Forums Search & Filter Pro Infinite scroll not working for me either

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #271015

    Hi The posts are displaying but no infinite scroll. Cannot see the loader either. Can you help?

    Here’s what I have done:

    1. Set settings as per https://searchandfilter.com/documentation/search-results/infinite-scroll/
    screenshot here: https://imgur.com/vloOCYk

    2. Added shortcode to page
    <?php echo do_shortcode('[searchandfilter id="2348" show="results"]'); ?>

    3. Created search-filter folder in theme, moved results-infinite-scroll.php to this folder and renamed results.php.

    Here is the code (theme/search-filter/results.php):

    <?php
    // If this file is called directly, abort.
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    
    if ( $query->have_posts() )
    {
    	?>
    	Found <?php echo $query->found_posts; ?> Results<br />
    	<div class='search-filter-results-list'>
    	<?php
    		while ($query->have_posts())
    		{
    			$query->the_post();
    			
    			?>
    			<div class='search-filter-result-item'>
    				
    			<div style="padding: 5rem; background-color: lightblue; margin-bottom: 1rem;"> 
    			<p><?php the_title(); ?></p>
    				</div>
    
    			</div>
    			
    			<?php
    		}
    	?>
    	</div>
    <?php
    }
    else
    {
    	?>
    	<div class='search-filter-results-list' data-search-filter-action='infinite-scroll-end'>
    		<span>End of Results</span>
    	</div>
    	<?php
    }
    ?>

    Thanks for your help!

    Trevor
    #271044

    I placed the code you posted inside code ticks for you.

    Nothing jumps out to me as wrong. If I could see the site (which I cannot as it is on localhost) I would check two things:

    1. Look for JavaScript errors (red ones) in the browser web developer tools console. In Chrome on Windows, press F12 to see the tools, then switch to the Console tab. You may need to look at the source of the error to figure where it comes from.
    2. Is our JavaScript file being loaded on to the page? Look at the page source HTML (ctrl+U on that same Chrome+Windows PC), and search for the filename:

    wp-content/plugins/search-filter-pro/public/assets/js/search-filter-build.min.js

    Of course, even better would be if you can upload the site to a staging server, so I could then have access.

    Anonymous
    #271140

    All working now. Was a conflict with another plugin. Thanks for the quick response.

    Trevor
    #271142

    Thanks for letting me know. I will close this thread for now.

Viewing 4 posts - 1 through 4 (of 4 total)