-
-
How can I adjust the number of products or categories shown on various Woocommerce pages? I’d like to totally eliminate pagination on all pages displaying either products or categories.
Thanks for your help
-
Hello,
Can i please see a link of the page you want to remove the pagination? What element of Visual Composer are you using? In the Recent products element you can set up the number of products to show up in the elements options.
Let us know.
Best regards! -
-
Hello,
Sorry for the late reply.
Please go to file functions-woocommerce.php and find this line:
add_filter('loop_shop_per_page', create_function('$cols', 'return 12;'), 20);
The value 12, represents the number of products per page in the shop page. Change it to your wish. Example:
add_filter('loop_shop_per_page', create_function('$cols', 'return 999;'), 20);
It will show a max of 999 products per page.
Let us know.Best regards!
-
The functions-woocommerce.php file has changed a bit since I first posted this question. I have been able to make the change to the line as follow.
add_filter(‘loop_shop_per_page’, function(){ return 999; }, 20 );
I would like to keep this change in the child them rather than edit the file in the theme. Where should I locate this file in the child theme so it’s picked up? I put it in the root of the child theme but that didn’t work. Tried the woocommerce folder in the child theme. But no luck there? Where should I put it?
-
Hello,
To overwrite a parent theme file in the child theme, you need to add that file with the same file path as in parent. But, not all parent theme’s files can be added/overwriten in child theme. Sorry but this can not be overwritten in child theme.
At max, you can remove the filter from the parent and place it in your child theme functions.php file. See screenshots:
https://ibb.co/MsndS0B
https://ibb.co/8jHGvZGBest regards!
-
This reply was modified 5 years, 6 months ago by
Mirela.
-
This reply was modified 5 years, 6 months ago by
-
You must be logged in to reply to this topic.