The last posts and the link paging are appearing, but when I click the link , the URL changes to /page/2/
but stays with the same content on the first page .
Does anyone know how I can resolve?
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array( 'post_type' => 'post', 'posts_per_page' => 8, 'paged' => $paged );
$wp_query = new WP_Query($args);
while ( have_posts() ) : the_post(); ?>
<div class="noticia-index">
<a href="<?php the_permalink(); ?>"><div class="post-thumbnail">
<?php the_post_thumbnail(); ?>
</div></a>
<div class="noticia-index-conteudo"><a href="<?php the_permalink(); ?>"><h2 class="noticia-titulo"><?php the_title(); ?></h2></a>
<div class="subtitulo-noticia"><?php the_excerpt(); ?></div>
<span class="icone-time"><img src="<?php echo get_stylesheet_directory_uri(); ?>/img/icones/time-icon.png"></span>
<span class="time"><?php the_time(); ?></span>
<span class="icone-comment"><img src="<?php echo get_stylesheet_directory_uri(); ?>/img/comment.png"></span>
<span class="comments">1</span>
<a class="leia-mais" href="<?php the_permalink(); ?> ">Leia mais...</a>
</div>
</div>
<?php endwhile; ?>
<!-- Links de paginação -->
<?php next_posts_link( '← Older posts', $wp_query ->max_num_pages); ?>
<?php previous_posts_link( 'Newer posts →' ); ?>