M
M
mipfikus2020-06-09 23:19:43
WordPress
mipfikus, 2020-06-09 23:19:43

How to display all products at once?

It is necessary to display all products on the category page, and not 16 as it is now.
Theme: Storefront.
This code doesn't help:

add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 18;' ), 20 );

Thanks

PS

Displays 16 products because I changed 3 columns to 4.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Sedov, 2020-06-10
@mipfikus

To display all products on the category page, use

function change_product_query($query) {
  $query->set( 'posts_per_page', -1 );
}
add_action( 'pre_get_posts', 'change_product_query' );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question