Woocommerce店面主题在产品页

时间:2018-06-18 10:32:33

标签: wordpress woocommerce storefront

出于某种原因,我在产品页面上显示了两次产品信息。请参阅随附的屏幕截图。

有没有人见过这个?

产品信息重复

Product Information Duplicate 单一产品代码(根据要求)

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

get_header( 'shop' ); ?>

<style>#primary {padding: 0px;margin: auto auto;width: 90%;} </style>

<?php get_sidebar(); ?>

<?php
    /**
     * woocommerce_before_main_content hook.
     *
     * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
     * @hooked woocommerce_breadcrumb - 20
     */
    do_action( 'woocommerce_before_main_content' );
?>

    <?php while ( have_posts() ) : the_post(); ?>

        <?php wc_get_template_part( 'content', 'single-product' ); ?>

    <?php endwhile; // end of the loop. ?>

<?php
    /**
     * woocommerce_after_main_content hook.
     *
     * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
     */
    do_action( 'woocommerce_after_main_content' );
?>

<?php
    /**
     * woocommerce_sidebar hook.
     *
     * @hooked woocommerce_get_sidebar - 10
     */
    do_action( 'woocommerce_sidebar' );
?>

<?php get_footer( 'shop' );

0 个答案:

没有答案
相关问题