duanao4503 2013-05-30 00:52
浏览 144

删除侧边栏商店页面woocommerce

I've been desperately searching for help with this. I would really love to remove the sidebar only from my woocommerce shop base page. In the admin options for my theme there's a place to enable the sidebar on the product page but what you select there impacts not just the shop base page but all of the archive pages.

Within the archive-product.php file there's code that controls the layout based on if that button is enabled so I thought my best bet would be to use an if else statement to say if its the shop page, use the 'no-sidebar' class. This is what I came up with but it's not working. Any thoughts would be fantastic.

<?php if ( is_object( $shop_page) ) : ?>
<div id="default_products_page_container" class="no-sidebar">
<?php elseif (have_posts() ) : ?>
<div id"default_products_page_container" class="with-sidebar">  
  • 写回答

4条回答 默认 最新

  • douxi8119 2013-05-30 01:32
    关注

    Maybe check out the theme you are using and remove the code for the sidebar from the template.

    评论

报告相同问题?

悬赏问题

  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办