Paging is not working in search.php on the site I'm developing. When I ask to show all products, it shows the pagination correctly, but when I do a search where results are generated for several pages, it only returns me to the first page and does not give me the option to change to the next page, as shown in the page of all products.
search.php: < / h2 > - >
woocommerce_product_loop_start();
woocommerce_product_subcategories();
while (have_posts()):
the_post();
wc_get_template_part('content', 'product');
endwhile; // end of the loop.
woocommerce_product_loop_end();
/**
* woocommerce_after_shop_loop hook.
*
* @hooked woocommerce_pagination - 10
*/
do_action( 'woocommerce_after_shop_loop' );
<?php
elseif (!woocommerce_product_subcategories(array(
'before' => woocommerce_product_loop_start(false),
'after' => woocommerce_product_loop_end(false)
))):
wc_get_template('loop/no-products-found.php');
endif;
?> </div><!-- /pagina-loja__dir --></div><!-- /row --></div><!-- /container --></div><!-- /pagina-loja --> <?php
get_footer('shop');
?>