I’m trying to use the Infinite Scroll plugin for WordPress. I set it up and it doesn’t work.
Screen of settings:
Template file
<div id="posts-wrapper" class="row main">
<?php $counter = 1; ?>
<?php if ( have_posts() ){ while ( have_posts() ){ the_post(); ?>
<?php $url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' ); ?>
<div class="single-post <?php if( $counter == 5 ) { echo "col-xs-12 col-sm-12 col-md-8 col-lg-8"; } else { echo "col-xs-12 col-sm-6 col-md-4 col-lg-4";} ?>">
<div class="thumbnail">
<div class="category-wrapper"><?php the_category(', ');?></div>
<a class="href-overlay" href="<?php the_permalink(); ?>"><div class="wrapper">
<div class="<?php if( has_term( 'hot', 'hot', $post->ID ) ){ echo "inside inside-hot"; } else { echo "inside";} ?>"><div class="image-cover" style="background-image: url(<?php echo $url[0]; ?>)"></div></div>
</div></a>
<div class="post-wrapper">
<p class="post-created-by">Napisane przez <strong><span class="special"><?php echo get_the_author(); ?></span></strong> | <i class="glyphicon glyphicon-comment"></i> <?php comments_number( '0' , '1' , '%' ); ?></p>
<h2 class="post-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
</div>
</div>
<?php $counter++ ; ?>
<?php }else{ ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php } ?>
</div>
<div id="paginacja">
<?php next_posts_link('wczytaj wiÄcej »')?>
</div>
What am I doing wrong?