Duplicating first 5 posts
-
Not sure what is causing this but I’m sure it’s an error that I made when editing the repeater template and I’m just not catching it. Hopefully someone here can help though.
Basically I have it set to load 5 posts at a time (that’s also what I have WordPress defaulted to show). When I click on the button to load more it loads those first 5 again. Then when I click it one more time it loads the next 5 posts (how it should have done it the first time).
Anyways, here is the code for my repeater template as I imagine that’s what’s causing the duplication. Let me know if I need to post anything else though.
<div> <?php if ( has_post_thumbnail() ): { $src = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); }?> <div class="featured-image-full-width" style="background-image: url( <?php echo $src; ?> ) !important; height: 400px; background-size: cover; background-repeat: no-repeat; background-position: center;"></div> <?php endif; ?> <header class="entry-header"> <?php the_title( sprintf( '<h2 class="entry-title">', esc_url( get_permalink() ) ), '</h2>' ); ?> </header> <div class="entry-content"> <?php the_excerpt( sprintf( wp_kses( __( 'Continue reading %s <span class="meta-nav">→</span>', 'tct-redi' ), array( 'span' => array( 'class' => array() ) ) ), the_title( '<span class="screen-reader-text">"', '"</span>', false) )); ?> <hr /> </div> </div>
The topic ‘Duplicating first 5 posts’ is closed to new replies.