Repeating posts 5 times on “Load more”
-
Hello,
I am having some problems with the plugin…
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 5 posts, but instead is displaying 5 different posts 5 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?
- The topic ‘Repeating posts 5 times on “Load more”’ is closed to new replies.