使用产品更改 wordpress 主页
change wordpress homepage with product
我有一个用于 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 的产品,但我不知道如何做展示产品
有人帮帮我吗?非常感谢
如果您只是想模拟 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>
只需将 'id="1"' 参数替换为与您在 WooCommerce 中的产品关联的任何产品 ID
我有一个用于 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 的产品,但我不知道如何做展示产品
有人帮帮我吗?非常感谢
如果您只是想模拟 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>
只需将 'id="1"' 参数替换为与您在 WooCommerce 中的产品关联的任何产品 ID