Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Load more button returning duplicate items and not displaying first 16 items

$
0
0

Replies: 0

Hello,

I’m using the plugin Ajax Load More to have a button “Load more” under the first 16 items of a custom post type (backstages). The issue I’m facing is:
– I can’t display the first 16 items before displaying the button (I only have the button so far)
– when hitting the load more button, it displays duplicate items (I have only 23 in total and I see more than 30 rows of two items).
I have put the following query in the Repeater Template:

<?php  query_posts('post_type=backstages');?>
    <div class="container">
      <div class="row">
        <?php while ( have_posts() ) : the_post();
          $photo = get_the_post_thumbnail();
          $titre = get_the_title();
          $link = get_field('link');
          $size = "full"; ?>

          <div class="vc_col-sm-6 rowbackstage">
            <?php echo $photo; ?>
            <p class="titrebackstage allbackstages"><?php if( $link ): ?><a class="backstageslink" target="_blank" href="<?php echo esc_url( $link ); ?>"><?php endif; ?><?php the_title(); ?></a></p>
          </div>
        <?php endwhile; ?>
      </div>
    </div>

 <?php wp_reset_query(); // resets the aletered query back to the original

And here is my shortcode: [ajax_load_more container_type=”div” post_type=”backstages” posts_per_page=”6″ post_format=”standard” orderby=”menu_order” offset=”16″ pause=”true” scroll=”false” button_label=”Charger plus” button_loading_label=”Chargement…” button_done_label=”Toutes les images sont affichées”]

I’m clearly missing something here but I don’t know what. Could you help me?

Thanks a lot!


Viewing all articles
Browse latest Browse all 59525

Trending Articles