AJAX Load More plugin: Repeating posts 6 times on “Load more”

324
May 04, 2017, at 5:49 PM

I am having some problems with the AJAX Load More plugin in Wordpress… I have created a new repeater template, but when the “load more” button is clicked, it displays the same posts 5 times… What it should do is display 6 posts, but instead is displaying 6 different posts 6 times…

This is my Shortcode:

<?php echo do_shortcode('[ajax_load_more post_type="post" posts_per_page="6" pause="true" offset="7" scroll="false" button_label="Load more"]'); ?>

This is my Repeater template:

<?php 
$loop_one = array( 
    'category_name'  => 'article',
    'posts_per_page' => 4,
    'orderby' => 'post__in'
);
$query_one = new WP_Query( $loop_one ); ?>
    <?php if ( $query_one->have_posts() ) :
        while ( $query_one->have_posts() ) : $query_one->the_post(); ?>
            <?php if (has_post_thumbnail()) {
                the_post_thumbnail(array(150,150)); } ?>
            <h3>
                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
            </h3>
            <p class="entry-meta">
                <?php the_time("F d, Y"); ?>
            </p>
            <?php the_excerpt(); ?>
    <?php endwhile; ?>
        <?php wp_reset_postdata(); ?>
    <?php else : ?>
        <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
    <?php endif; ?>

EDITED:

I've changed the shortcode to posts_per_page="1" and that solve the problem of repeating the posts 6 times. So now, when I click "Load more" it displays 4 posts, but when I click again to see more posts, it displays the same 4 posts... Any idea why?

READ ALSO
Tree structured Dropdown with search box to filer in angularjs

Tree structured Dropdown with search box to filer in angularjs

I am looking for a control in angularjs/jquery which is similar to below image (multi select search tree) but it should allowed to select only one option at a time ie

225
how to delete the first 2 li elements via jQuery

how to delete the first 2 li elements via jQuery

I am cloning 2 li elements at the end of my list, and after that I would love to delete the first 2I am trying to achieve an infinite carousel

296
Refused to execute script because MIME type (&#39;text/html&#39;) is not executable, and strict MIME type checking is enabled

Refused to execute script because MIME type ('text/html') is not executable, and strict MIME type checking is enabled

I am trying to get data((some quotes) from forismatic api but i am not getting any responseI am using ajax in jquery, but i am getting the following error in my console:

617