0
votes

I'm using an array inside WP_Query, this is for the index.php page. The code is like so

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

    $args = new WP_Query( array(
       'post__not_in'       => $exclude_ids, // This works correctly
       'paged'              => $paged,
       'posts_per_page'     => 9, // I added this as a hope but didn't work
    ) );

$the_query = new WP_Query( $args ); ?>



<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

but the paged is not working. I echod took the $paged out and it is doing 1,2,3 like it should (I'm assuming?) so it that part is working, and the URL is changing and the pagination link recognises it's on page 1,2,3 but the posts are all the same.

1
I changed the 'paged' to 2 and 3 but the posts are still the same.Sjrsmile

1 Answers

0
votes

Turns out I'm dumb.

I had but the $args as new WP_Query while it should have just been the array.