0

this is not much of a question than a solution to a problem that i couldnt find.

Problem: On category archive made with custom query i could not get /page/2 to work ( always 404 ).

Tried every possible solution in the book, and finally i reverted back to the original query, there i wanted to change posts per page for this query to check if the problem is caused by my custom query. It appears that woocommerce changes posts per page with Apperance > Customize panel and dosn't use the Settings > Reading page. When you set there the number of items per row * number of rows to match your custom query demand all starts to work fine. Too bad that woocommerce had to make it so weird ( i kinda see the point why it is that way, just its very confusing) :D

Anyways i hope this helped someone, i wasted a healthy 2-3 hours on searching for solution. Cheers!

3
  • Please write your solution as an answer, and then accept this answer.
    – fuxia
    Commented Jan 9, 2020 at 4:05
  • Thanks for info, i posted my answer but cant mark it for 2 days from now :) Thanks for help
    – Patryk
    Commented Jan 9, 2020 at 4:19
  • The problem is that you're using a custom query with pagination to begin with. If you want to change the posts that appear in an archive, you should modify the existing main query, not create a separate query in the template. Commented Jan 9, 2020 at 5:48

1 Answer 1

0

As stated in question, the solution to that problem is to set the woocommerce posts per page ( Apperance > Customize ) and your custom 'posts_per_page' to the same number. Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.