For whatever reason the posts_per_page parameter isn’t working, only shows all content. Any idea why?

<?php
$args = array(
    'tax_query' => array(
        array(

            'posts_per_page' => 2,
            'order' => 'DESC',
            'taxonomy' => 'genero',
            'field' => 'slug',
            'terms' => 'reviews',

        )
    )
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
    while ( $query->have_posts() ) {
        $query->the_post();?> 

<?php the_title(); ?>

<?php

}
 }
wp_reset_query();  // Restore global post data stomped by the_post().
?>

Read more here: WordPress custom post, posts_per_page not working


Solution:

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: