I need to display only the last 3 posts but i get 10 posts (Reading Settings).

Any idea ?

$args = array( 'post_type' => 'post', 'posts_per_page' => 3);
$wp_query = new WP_Query($args);
while ( have_posts() ) : the_post(); ?>

                <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
            <?php the_excerpt(__('(more…)')); ?>

<?php endwhile; ?>
<?php wp_reset_postdata(); ?>

Read more here: WP_query : Force last posts number over Reading Settings


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: