Returning Duplicate Items at the beginning and end of the loop
-
Hello, I have the problem the custom post type called “issues” are duplicated the 2 most recent posts at the beginning and end of the loop of my page, this happens when I add order = “ASC” in the shortcode.
My code:
<div class="right"> <?php $the_query = new WP_Query( array( 'posts_per_page' => 15, 'post_type' => 'issues' ) ); ?> <div class="grid issues thumbs mtxs"> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <div class="issue"> <a href="{{ get_the_permalink() }}"> <figure class="lazy-container"> <img class="b-lazy" src="{{ the_post_thumbnail_url('thumbnail') }}" data-src="{{ the_post_thumbnail_url('large') }}" alt="{{ get_the_post_thumbnail_caption() }}" /> </figure> <p class="issue-number mb0"><?= get_field('number'); ?></p> <p class="issue-title mt0">{{ the_title() }}</p> </a> </div> <?php endwhile; ?> </div> <?= do_shortcode('[ajax_load_more offset="15" post_type="issues" container_type="div" css_classes="grid issues thumbs" transition_container="false" pause="true" posts_per_page="15" scroll="false" transition="none" order="ASC" button_label="Load More"]'); ?> </div>This are two firsts recent posts http://prntscr.com/n2viwr and this last http://prntscr.com/n2vjtb
Test with Version 5.0.0 and Version 5.0.1
How I solve this?
Thank you for you help.- This topic was modified 7 years, 2 months ago by .
- This topic was modified 7 years, 2 months ago by .
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Returning Duplicate Items at the beginning and end of the loop’ is closed to new replies.