0

I have a store with several products. Pagination works fine on the main shop page.

But when I open a separate product category or product tag pages, in some of them pagination not working as expected.

Overall posts per page are set to 9.

The product categories and product tags are assigned in Products and in two custom post types as well.

Suppose I have 10 product categories for my store. 

  • 6-7 of them working perfectly fine for pagination.
  • 4-3 of them are acting oddly in case of pagination, it shows a random number of products on each page.
  • Sometimes it shows 5 products on the first page, no products on the second page, 4 products on the third page & so on, but never more than 9 products.

I also tried switching themes and deactivating all plugins other than woocommerce, to check if there is any conflict that creates such an issue.

Is anyone knows, why this issue occurs & how I can solve it? I am trying to solve it from last so many weeks, but no luck yet.

Thanks!

  • Are you discarding the main query then creating a second brand new query so you can adjust what gets shown on the page via get_posts/WP_Query/query_posts? – Tom J Nowell Mar 4 at 12:31
  • No @TomJNowell , I didn't modify the main query. – rohit1113 Mar 5 at 4:42
  • Note: The product categories and product tags are assigned in Products and in two custom post types as well. – rohit1113 Mar 5 at 10:18
  • And you don't have a pre_get_posts filter setup? What changes did you make that caused this to happen? Have you contact the support vendor for your theme? Keep in mind that WooCommerce and other 3rd party plugins/themes are offtopic here – Tom J Nowell Mar 5 at 13:45
  • We used pre_get_posts only for the custom post types. – rohit1113 Mar 6 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.