WordPress custom post, posts_per_page not working

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

Leave a Reply

Your email address will not be published. Required fields are marked *