WooCommerce [products] shortcode not displaying pagination

Viewed 1645

I am trying to display to display woocommerce products with pagination. it should show 12 products per page. I am using the short code [products limit="-1" columns="4" paginate="true"] on a page. Right now it displays all products on the page with no pagination. Can anyone help.

1 Answers

The WooCommerce Shortcode documentation says for paginate attribute:

paginate – Toggles pagination on. Use in conjunction with limit. Defaults to false, set to true to paginate .

So that means that you need to limit the number of products to something smaller than the total number of queried products. So the limit attribute need to be a multiple of columns attribute value, so in your case something like 4, 8, 12, 16, 20…

So for example using [products limit="16" columns="4" paginate="true"] will display on the page a grid of 4 x 4 products with the pagination…

So limit="-1" disable the pagination logically.

Usage in php code: echo do_shortcode('[products limit="16" columns="4" paginate="true"]');

Related