This is the code I'm using to show recent posts from specific category on the homepage on my Wordpress website. But the issue I'm facing is that WP-pageNavi
plugin isn't working properly.
<div class="frontleft">
<div id="four-columns" class="grid-container" style="display:block;">
<?php $catquery = new WP_Query( 'cat=3&posts_per_page=24' ); ?>
<ul class="rig columns-4">
<?php while($catquery->have_posts()) : $catquery->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail( 'single-post-thumbnail' ); ?>
</a>
<h3>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
</h3>
</li>
<?php endwhile; ?>
</ul>
</div>
<div class="navigation">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
<?php } ?>
</div>
</div>
Note: I'm able to open mywebsite.com/page/2
without having any issue. But the post list is exactly same on each page.
How to fix it?