用产品更改wordpress主页

时间:2017-07-28 14:26:31

标签: php wordpress woocommerce e-commerce

我有一个针对woocommerce的i-craft wordpress主题

我想设置一个静态主页,但主题在仪表板中无法正常工作

我转到主题的index.php页面,我想改变这个:

<div class="blog-columns" id="blog-cols">
        <?php /* The loop normal posts */ ?>
        <?php while ( have_posts() ) : the_post(); ?>
            <?php get_template_part( 'content', 'single-product-customcateg' ); //get_post_format() ?>
        <?php endwhile; ?>
        </div>

与woocommerce的产品,但我不知道我怎么做显示产品

谁有人帮我?非常感谢

1 个答案:

答案 0 :(得分:0)

如果您只是想模仿WooCommerce如何通过Shortcode显示其产品,您可以这样做:

<div class="blog-columns" id="blog-cols">
    <?php /* The loop normal posts */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
        <?php get_template_part( 'content', 'single-product-customcateg' ); //get_post_format() ?>
        <?php echo do_shortcode('[product id="1"]') ?>
    <?php endwhile; ?>
</div>

只需更换&#39; id =&#34; 1&#34;&#39; WooCommerce中与您的产品相关联的任何产品ID的参数

相关问题