Я пытаюсь создать несколько пользовательских страниц Woocommerce, пока все прошло хорошо, однако я столкнулся с проблемой при использовании "woocommerce_product_loop" для перечисления продуктов.
Цикл добавленияпервый продукт в цикле к другим частям страницы - мой цикл находится внутри тега div с классом «store-content», но при проверке страницы я вижу 13 экземпляров тегов с URL-адресом продукта, который больше всего находится вне содержащего div -У меня также есть только 2 продукта
Если я удаляю цикл и обновляю, все теги исчезают, поэтому я знаю, что это как-то связано с циклом
Использование Wordpress 5.2.1 – ru_GB Woocommerce 3.6.4
<div class="col-9">
<div id="store-content" class="col-12">
<?php
if ( woocommerce_product_loop() ) {
do_action( 'woocommerce_before_shop_loop' );
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) : the_post();
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
endwhile;
};
woocommerce_product_loop_end();
do_action( 'woocommerce_after_shop_loop' );
} else {
do_action( 'woocommerce_no_products_found' );
}; ?>
</div>
</div>
(...)
<div class="col-9">
<div id="store-content" class="col-12">
<div class="columns-3">
<div class="lmp_load_more_button br_lmp_prev_settings" style="display: none;">
<a class="lmp_button btn btn-info" style="font-size: 22px;color: #ffffff;background-color: #17a2b8;padding-top:15px;padding-right:25px;padding-bottom:15px;padding-left:25px;margin-top:px;margin-right:px;margin-bottom:px;margin-left:px; border-top: 0px solid #117a8b; border-bottom: 0px solid #117a8b; border-left: 0px solid #117a8b; border-right: 0px solid #117a8b; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-left-radius: 15px; border-bottom-right-radius: 15px;" href="#load_next_page">Load Previous</a>
</div>
<ul class="products columns-3">
<li class="store-product product type-product post-384 status-publish first instock product_cat-bags_luggage product_cat-lunchboxes product_tag-featured has-post-thumbnail taxable shipping-taxable purchasable product-type-simple berocket_lmp_first_on_page" data-url="http://localhost:8889/product-category/bags_luggage/">
<a href="http://localhost:8889/wp_archive/bags_luggage/lunchboxes/15468/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">
<img width="300" height="300" src="http://localhost:8889/wp-content/uploads/2019/06/product-backpack-500-300x300.png" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail hoverZoomLink" alt="Test product" srcset="http://localhost:8889/wp-content/uploads/2019/06/product-backpack-500-300x300.png 300w, http://localhost:8889/wp-content/uploads/2019/06/product-backpack-500-100x100.png 100w, http://localhost:8889/wp-content/uploads/2019/06/product-backpack-500.png 500w" sizes="(max-width: 300px) 100vw, 300px">
<div class="product-text">
<h2 class="woocommerce-loop-product__title">15468</h2><div>£150</div>
</div>
</a>
</li>
<li class="store-product product type-product post-379 status-publish instock product_cat-bags_luggage product_cat-luggage product_tag-featured has-post-thumbnail taxable shipping-taxable purchasable product-type-simple">
<a href="http://localhost:8889/wp_archive/bags_luggage/lunchboxes/15468/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"></a>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">
<img width="300" height="300" src="http://localhost:8889/wp-content/uploads/2019/06/store-plate-300x300.png" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail hoverZoomLink" alt="test" srcset="http://localhost:8889/wp-content/uploads/2019/06/store-plate-300x300.png 300w, http://localhost:8889/wp-content/uploads/2019/06/store-plate-100x100.png 100w" sizes="(max-width: 300px) 100vw, 300px">
<div class="product-text">
<h2 class="woocommerce-loop-product__title">testr</h2>
<div>£34</div>
</div>
</a>
</li>
</ul>
<div class="lmp_load_more_button br_lmp_button_settings" style="display: none;">
<a class="lmp_button btn btn-info" style="font-size: 22px;color: #ffffff;background-color: #17a2b8;padding-top:15px;padding-right:25px;padding-bottom:15px;padding-left:25px;margin-top:px;margin-right:px;margin-bottom:px;margin-left:px; border-top: 0px solid #117a8b; border-bottom: 0px solid #117a8b; border-left: 0px solid #117a8b; border-right: 0px solid #117a8b; border-top-left-radius: 15px; border-top-right-radius: 15px; border-bottom-left-radius: 15px; border-bottom-right-radius: 15px;" href="#load_next_page">Load More</a>
</div>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"></a>
</div>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"></a>
</div>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"></a>
</div>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"></a>
</div>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"></a>
</div>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">
<div class="snow-break" style="bottom:-80px;"><!-- boop --></div>
</a>
</section>
<a href="http://localhost:8889/wp_archive/bags_luggage/luggage/testr/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">
Нет ошибок в консоли, как я могу остановить печать дубликатов http://localhost:8889/wp_archive/bags_luggage/luggage/testr/ a тегов?