带货物,当您单击产品时,没有进入该产品的卡中,链接是正确形成的,但是页面的内容没有改变,这就是我带来该产品的方式:
<?php get_header(); ?>
<div class="content-about">
<div class="wrap">
<div class="wrap-product">
<h2 class="about-title">Мои товары</h2>
<div class="product-list">
<?php
$custom_query = new WP_Query( array( 'post_type' => 'product'));
if ($custom_query->have_posts()) : while ($custom_query->have_posts()) : $custom_query->the_post();
global $product;
?>
<div class="item-product">
<div class="img-prod">
<?php the_post_thumbnail(); ?>
</div>
<div class="name-prod"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
<div class="rating-prod"></div>
<div class="price-prod"><?php echo $product->get_price_html(); ?></div>
<div class="add-cart">
<?php woocommerce_template_loop_add_to_cart(); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php wp_reset_query(); ?>
<?php /*woocommerce_content();*/ ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
<?php get_header(); ?>
<div class="content-about">
<div class="wrap">
<div class="wrap-product">
<h2 class="about-title">Мои товары</h2>
<div class="product-list">
<?php
$custom_query = new WP_Query( array( 'post_type' => 'product'));
if ($custom_query->have_posts()) : while ($custom_query->have_posts()) : $custom_query->the_post();
global $product;
?>
<div class="item-product">
<div class="img-prod">
<?php the_post_thumbnail(); ?>
</div>
<div class="name-prod"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
<div class="rating-prod"></div>
<div class="price-prod"><?php echo $product->get_price_html(); ?></div>
<div class="add-cart">
<?php woocommerce_template_loop_add_to_cart(); ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php wp_reset_query(); ?>
<?php /*woocommerce_content();*/ ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
当您单击产品名称时,不会转到该产品: enter image description here