Can you tell me what exactly was messed up on the latest update?
I was able to fix my issue playing around with a few things. My first mistake was using post_count instead of found_posts. The first one return the number of results on the current page. The second one returns the total number of posts found.
Also, instead of resetting postdata before calling pagenavi() I did that after. I guess that makes sense but I’m still not super comfortable playing with the wp_query.
Anyway, it seems to work fine!
If anyone is looking to do the same…
Craft your custom query in search.php:
global $query_string;
wp_parse_str( $query_string, $search_query );
$newsearch = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'publish',
'order_by' => 'post_date',
'order' => 'ASC',
'posts_per_page' => 6,
'nopaging' => false,
's' => $search_query[s]
));
Then the main loop should look like this:
<div class="x-section" id="search-main">
<div class="x-container max width">
<?php if ( $newsearch->have_posts() ) : ?>
<div id="x-iso-container" class="x-iso-container">
<?php
while ( $newsearch->have_posts() ) : $newsearch->the_post();
$stack = x_get_stack();
x_get_view( $stack, 'content', get_post_format() );
endwhile;
?>
</div>
<?php pagenavi(); ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<?php x_get_view( 'global', '_content-none' ); ?>
<?php endif; ?>
</div>
</div>
PS: We use the iso-container because we loaded the isotope script on our search results, but if you’re not loading the script you’ll have display issues.