Última atividade 1713290210

Revisão 5ee1e741fa104caf465f84f1c3be1818da011555

change-products-per-page.php Bruto
1add_action( 'pre_get_posts', 'custom_woocommerce_products_per_page' );
2
3function custom_woocommerce_products_per_page( $query ) {
4 // Check if we're on a WooCommerce shop page or product category or tag page and if it's the main query
5 if( !is_admin() && $query->is_main_query() && (is_woocommerce() || is_product_category() || is_product_tag()) ) {
6 $query->set( 'posts_per_page', 9 ); // Set the number of products per page to 12
7 }
8}
9
10