I
I
Ilya Folg2020-07-12 18:06:29
WordPress
Ilya Folg, 2020-07-12 18:06:29

How to put all products on one store page?

For some reason, one product is displayed on the product page (shop), there should be all.
I have 26 products and each product is displayed on each individual store page through pagination.
That is, all should be displayed on the page, and one is displayed on each page through pagination.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mipfikus, 2020-07-12
@mipfikus

Display all products on one page:

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

Paste in functions.php of your theme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question