Reputation: 5
is there any solution for filtering by post categories with pagination. At present, it only filter the posts are in the current page, but not anymore. You can see here: The Method Case
Thanks!
Upvotes: 0
Views: 2264
Reputation: 372
You can use WP_Query
for this purpose. For example:
<?php
$posts = WP_Query(array(
'category_name' => 'my-category',
'paged' => 2 // Page 2
));
while($posts->have_posts()): $posts->the_post();
// do some stuff
endwhile;
?>
Upvotes: 1