我有一个关于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的产品,但我不知道如何为展示产品做
有没有人帮我?非常感谢
发布于 2017-07-28 22:55:17
如果您只想模拟WooCommerce如何通过短码显示其产品,您可以这样做:
<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>只需在WooCommerce中将‘id=“1’参数替换为与您的产品相关联的任何产品ID
https://stackoverflow.com/questions/45375976
复制相似问题