如何使我的 Woocommerce 单一产品页面页脚全宽?
How can i make my Woocommerce single-product page footer full width?
我正在努力使用我的 Woocommerce 插件扩展我的产品页面的页脚。每个其他页面都设置为全宽,但产品页面本身似乎没有继承这一点。
我认为(但不知道)我需要编辑单个 product.php 文件,所以这是当前代码...
<?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 文件末尾的结束 PHP 标记以避免 "headers already sent" 问题。 */
如果不是这个我就没脑子了
它被包装在 div 中,边距包装器 class 的最大宽度为 840px;
将页脚放在 div 之外。
- 如何解决这个问题
您的页面内容如下所示:
<div class="margin-wrapper">
<! -- All your site containers -->
<footer class="footer-wrapper brand-background" role="contentinfo">
</footer>
</div>
它应该是这样的
<div class="margin-wrapper">
<! -- All your site containers -->
</div>
<footer class="footer-wrapper brand-background" role="contentinfo">
</footer>
请注意页脚是如何位于您的内容包装器之外的。除此之外,您还必须了解基本的 html 结构。
我正在努力使用我的 Woocommerce 插件扩展我的产品页面的页脚。每个其他页面都设置为全宽,但产品页面本身似乎没有继承这一点。
我认为(但不知道)我需要编辑单个 product.php 文件,所以这是当前代码...
<?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 文件末尾的结束 PHP 标记以避免 "headers already sent" 问题。 */
如果不是这个我就没脑子了
它被包装在 div 中,边距包装器 class 的最大宽度为 840px; 将页脚放在 div 之外。
- 如何解决这个问题
您的页面内容如下所示:
<div class="margin-wrapper">
<! -- All your site containers -->
<footer class="footer-wrapper brand-background" role="contentinfo">
</footer>
</div>
它应该是这样的
<div class="margin-wrapper">
<! -- All your site containers -->
</div>
<footer class="footer-wrapper brand-background" role="contentinfo">
</footer>
请注意页脚是如何位于您的内容包装器之外的。除此之外,您还必须了解基本的 html 结构。