Answer the question
In order to leave comments, you need to log in
How to make 2 loops with custom parameters in archive-product.php?
I want to change this template https://github.com/woocommerce/woocommerce/blob/ma...
There is already a cycle here for both posts and categories, as I understand it.
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
/**
* Hook: woocommerce_shop_loop.
*
* @hooked WC_Structured_Data::generate_product_data() - 10
*/
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
}
}
woocommerce_product_loop_end();
wc_get_template_part( 'content', 'product' );
<?php
global $query_string; // параметры базового запроса
query_posts( $query_string .'&cat=-6,-9&order=ASC&posts_per_page=20' ); // базовый запрос + свои параметры
[СТАНДАРТНЫЙ ЦИКЛ WORDPRESS]
wp_reset_query(); // сброс запроса
?>
Answer the question
In order to leave comments, you need to log in
Don't use multiple query_posts on the same page!
https://wp-kama.ru/id_767/3-sposoba-postroeniya-ts...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question