Forums Forums Search & Filter Pro Infinite scroll – duplicated post

Viewing 10 posts - 1 through 10 (of 37 total)
  • Anonymous
    #229066

    Hello,

    I’m using the plugin in ajax and infinte scroll mode. Display method custom.
    Displays random duplicates. Other pages appear when refreshing.

    And plugin display duplicated post:
    http://i.epvpimg.com/ReXUbab.jpg

    Settings:
    http://i.epvpimg.com/pEMPbab.png

    TPL code:

    
    <?php get_header();?>
    
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="cars-stock-banner">
                    <?php 
    
                        $image = get_field('car-stock-photo');
                        $size = 'full'; // (thumbnail, medium, large, full or custom size)
                        if( $image ) {
                            echo wp_get_attachment_image( $image, $size, '', array( "class" => "lazyload" ) );
                        }
    
                    ?>
                    <div class="cars-stock-banner__content text-center">
    
                        <?php if (have_posts()): while (have_posts()) : the_post(); ?>
    
                        <?php the_content();?>
    
                        <?php endwhile; ?>
    
                        <?php endif; ?>
    
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-12">
                <div class="cars-stock-filters">
                    <!-- <div class="js-cars-stock-filters-button cars-stock-filters__button">
                        <?php _e('Filtrowanie (opcjonalnie)', 'cupra');?>
                    </div> -->
                    <div class="cars-stock-filters__form">
                        <?php echo do_shortcode('[searchandfilter id="464"]');?>
                    </div>
                </div>
            </div>
        </div>
        <?php
            $argsCars = array('post_type' => 'post');
            $argsCars['search_filter_id'] =  464;
            $queryCars = new WP_Query($argsCars);
        ?>
        <div id="cars-stock-ajax">
            <div class="cars-stock-infinite-scroll row">
                <?php if ($queryCars->have_posts()): while ($queryCars->have_posts()) : $queryCars->the_post(); ?>
                    <div class="col-12 col-sm-6 cars-stock-infinite-scroll-item">
                        <div class="row">
                            <div class="col-11">
                                <div class="cars-stock-item__img">
                                    <a href="<?php the_permalink();?>">
                                        <div class="cars-stock-item__location">
                                            <span>
                                                <?php the_field('location_car');?>
                                            </span>
                                        </div>
                                        <?php $foto = get_field('photo_1') ?>
                                        <img src="<?php echo $foto['sizes']['large'] ?>" alt="<?php the_title(); ?>" />
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-12 text-right">
                                <div class="cars-stock-item-info">
                                    <a class="cars-stock-item-info__link" href="<?php the_permalink();?>" title="<?php _e('Zobacz więcej', 'cupra');?>">
                                        <h3>
                                            <?php the_field('marka'); ?>&nbsp;<?php the_field('model'); ?>
                                        </h3>
                                    </a>
                                    <p class="cars-stock-item-info__price">
                                        <?php the_field('cena_promocyjna'); ?>
                                    </p>
                                    <p class="cars-stock-item-info__parameters">
                                        silnik: <?php the_field('pojemnosc_skokowa'); ?>&nbsp;<?php the_field('moc'); ?>
                                    </p>
                                    <p class="cars-stock-item-info__parameters">
                                        skrzynia: <?php the_field('skrzynia'); ?>
                                    </p>
                                    <a class="cars-stock-item-info__more" href="<?php the_permalink();?>" title="<?php _e('Zobacz więcej', 'cupra');?>">
                                        <?php _e('Zobacz więcej', 'cupra');?>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div> 
                <?php endwhile; 
            
                else:?>
    
                        <span data-search-filter-action='infinite-scroll-end'><?php _e('Brak więcej wyników');?></span>
    
                <?php endif; ?>
            </div>
        </div>
    </div>
    <div class="pagination">
        
    </div>
    
    <?php get_footer();?>
    

    Anyone can help me?

    Trevor
    #229067

    In the Posts tab, do you have Random sort selected?

    Anonymous
    #229069
    Anonymous
    #229071

    If i choose some option from search bar and click “search”, duplicate post disappear.

    Trevor
    #229192
    This reply has been marked as private.
    Anonymous
    #229216
    This reply has been marked as private.
    Trevor
    #229405

    Hi

    I can’t see anything obviously wrong. What happens if you move the wp_query PHP code inside the ajax container:

    https://www.screencast.com/t/a1jQMxjZwX

    Anonymous
    #229655

    Hello, still don’t work. Nothing changed. :/

    Anonymous
    #229660

    And i use 2.5.0 version.

    Anonymous
    #229662

    In database all is cached correct. No idea.

Viewing 10 posts - 1 through 10 (of 37 total)