Pagination in Wordpress using wp_pagenavi

0

I'm doing paging on wordpress using wp_paginavi. is working, it is creating the pagination, the problem is that the posts are not changing according to the pagination.

My loop:

<?php 

$the_query = new WP_Query(array(
    'post_type' => 'post',
    'category_name' => 'noticias'
    )); 
   while ( $the_query->have_posts() ) : 
   $the_query->the_post(); 
    $thumb = get_post_thumbnail_id();
        $img_url = wp_get_attachment_url( $thumb,'full' );
        $image2 = aq_resize($img_url, 150,150, $crop = true, $single = true, $upscale = true );
?>


  <div class="row index-blog">
    <div class="col-md-2"><img src="<?php echo $image2; ?>" class="img-responsive center-block" /></div>
    <div class="col-md-10">
        <h2><?php the_title(); ?></h2>
        <div><?php the_author_link(); ?> | <?php the_date('d-m-Y'); ?></div>
        <p><?php the_excerpt(10); ?></p>
        <div><a href="<?php the_permalink(); ?>"><img src="<?php bloginfo('template_url')?>/imagens/leia_mais.jpg" /></a></div>
    </div>
  </div>
  <?php 
   endwhile; 
   wp_reset_postdata();
  ?>
  <div class="pagin"><?php wp_pagenavi( array( 'post' => $the_query ) ); ?></div>

I think the problem is in my loop, could anyone help?

    
asked by anonymous 08.12.2015 / 02:23

0 answers