admin管理员组文章数量:1404758
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!
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!
Share Improve this question asked Jan 9, 2020 at 4:01 PatrykPatryk 12 bronze badges 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. – Jacob Peattie Commented Jan 9, 2020 at 5:48
1 Answer
Reset to default 0As 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.
本文标签: Woocommerce pagination problem page2404 solution
版权声明:本文标题:Woocommerce pagination problem- page2 = 404 solution 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744848658a2628364.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论