【问题标题】:How To Integrate Woocommerce With A Custom Wordpress Theme如何将 Woocommerce 与自定义 Wordpress 主题集成
【发布时间】:2017-09-06 22:33:41
【问题描述】:

我很难确定在我的 woocommerce.php 文件中添加 woocommerce 循环的位置。

这是page.php代码,

    <?php
/*
Package: OnAir2
Description: Normal single page template with sidebar
Version: 0.0.0
Author: QantumThemes
Author URI: http://qantumthemes.com
*/
?>
<?php get_header(); ?> 
    <?php  
    get_template_part ('phpincludes/menu');
    get_template_part ('phpincludes/part-searchbar'); 
    ?>
    <div id="maincontent" class="qt-main">
        <?php while ( have_posts() ) : the_post(); ?>
            <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                <!-- ======================= HEADER SECTION ======================= -->
                <?php get_template_part( 'phpincludes/part-header-caption-page'); ?>
                <!-- ======================= CONTENT SECTION ======================= -->
                <div class="qt-container qt-spacer-l">
                    <div class="row">
                        <div class="col s12 m12 l1 qt-pushpin-container">
                            <div class="qt-pushpin">
                                <?php get_template_part( 'phpincludes/sharepage' ); ?>
                            </div>
                             <hr class="qt-spacer-m">
                        </div>
                        <div class="col s12 m12 l8">
                            <div class="qt-the-content">
                                <?php the_content(); ?>
                            </div>
                            <?php if ( comments_open() || '0' != get_comments_number() ){  ?>
                                <hr class="qt-spacer-m">
                                <?php  comments_template(); ?>
                            <?php } ?>
                            <hr class="qt-spacer-l">
                        </div>
                        <div class="qt-sidebar col s12 m12 l3">
                            <?php get_template_part (  'phpincludes/sidebar' ); ?>
                            <hr class="qt-spacer-l">
                        </div>
                    </div>
                </div>
            </div>
        <?php endwhile; // end of the loop. ?>
        <?php get_template_part ( 'phpincludes/part-sponsors' ); ?>
    </div><!-- .qt-main end -->
    <?php get_template_part ( 'phpincludes/footerwidgets' ); ?>
    <?php get_template_part (  'phpincludes/part-player-sidebar' ); ?>
<?php get_footer(); ?>

在哪里添加

<?php woocommerce_content(); ?>

我曾尝试仅使用 get 页眉和页脚,但输出非常非常糟糕。由于开发人员没有使主题 woocommerce 兼容,因此我需要使其成为....

【问题讨论】:

    标签: wordpress woocommerce hook-woocommerce


    【解决方案1】:

    the_content(); 替换为woocommerce_content();。但它仍然不会采用设计。您必须手动使其与 woocommerce 兼容。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-14
    • 2018-02-24
    • 2015-03-15
    • 1970-01-01
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多