Infinite Scroll duplicate posts from 6th one
-
For a reason I can’t understand (due my low programing skills) when Infinite Scroll loads the new content, it repost the already loaded posts but the five first… I mean, the new loaded content begins at the 6th post of the 32 that load at document ready.
I played around with configuration but still I can’t figure out what I’m or missing or doing wrong.
I implemented Infinite Scroll using template parts like this:
<?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); // El cuerpo del post está en content.php get_template_part( 'content', get_post_format() ); endwhile; else: ?> <div class="large-12 medium-12 columns"> <h2>Ups</h2> <p>Vaya, parece que aún no hay artículos publicados aquí...</p> </div> <?php endif; ?>
that loads this:
<div id="post-<?php the_ID(); ?>" class="caja-post columns"> <div class="extracto-post"> <div class="extracto-imagen-caja"> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"> <div class="extracto-imagen"> <?php the_post_thumbnail('post'); ?> </div> </a> </div> <div class="extracto-info"> <div class="extracto-categoria"><?php the_category(' · ') ?></div> <div class="extracto-autor"><?php the_author_posts_link(); ?></div> <div class="extracto-fecha"><?php echo date_i18n('j \d\e\ F \d\e\ Y', time()); ?></div> </div> <?php edit_post_link('Editar', ''); ?> <h3 class="extracto-titulo"> <a title="Ver <?php the_title(); ?>" href="<?php the_permalink(); ?>" > <?php the_title(); ?> </a> </h3> <p class="extracto-texto"> <?php echo get_the_excerpt(); ?> </p> </div> </div>
and with this configuration:
/* Scroll Infinito */ function code_new_infinite_scroll_init() { add_theme_support( 'infinite-scroll', array( 'container' => 'loop', 'footer' => false, 'posts_per_page' => '32', 'wrapper' => 'infinite-posts' ) ); } add_action( 'init', 'code_new_infinite_scroll_init' );
The theme is a custom one, and I didn’t set post offsets anywhere
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Infinite Scroll duplicate posts from 6th one’ is closed to new replies.