我使用的是“店面主题”,在“商店前沿”主题的“产品页”和“产品类别页”中,页面中有全宽度选项
当我使用css时,我在模板中使用这一行
<div id="primary" class="content-area">
当我删除内容区域类时,我可以删除侧栏的空间,但这不是我所期望的,因为它正在整个网站中删除侧栏。
我只需要在产品页面中删除,而不能在产品类别页面中删除,这是如何在商店主题中实现的。
发布于 2016-02-11 17:15:08
对于产品页面,可以放入functions.php
function remove_storefront_sidebar() {
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
}
}
add_action( 'get_header', 'remove_storefront_sidebar' );
它与最新的woocommerce 2.5.2一起工作,还需要CSS:
.single-product.right-sidebar .content-area {
float: none;
margin-right: 0;
width: 100%;
}
发布于 2016-10-29 01:31:35
只需转到主题选项,选择woocommerce,并将产品、商店和类别布局更改为1列(而不是带有侧栏的2列)。
https://wordpress.stackexchange.com/questions/208384
复制