java添加面板在界面的底部,Woocommerce制作侧边栏显示在页面底部

我想通了,这是一个适合我的“框架”,万一有人需要它:

if (!function_exists('custom_open_woocommerce_content_wrappers')) {

function custom_open_woocommerce_content_wrappers(){

echo '

';

}

}

if (!function_exists('custom_close_woocommerce_content_wrappers')) {

function custom_close_woocommerce_content_wrappers(){

echo '

';

}

}

if (!function_exists('custom_product_wrapper_open')) {

function custom_product_wrapper_open(){

echo '

';

}

}

if (!function_exists('custom_product_wrapper_close')) {

function custom_product_wrapper_close(){

echo '

';

}

}

if (!function_exists('custom_before_shop_loop_sidebar')) {

function custom_before_shop_loop_sidebar() {

echo '';

dynamic_sidebar(get_theme_mod('shop_sidebar', ''));

echo '';

}

}

add_action( 'woocommerce_after_shop_loop', 'custom_before_shop_loop_sidebar', 20);

if (!function_exists('custom_prepare_woocommerce_wrappers')) {

function custom_prepare_woocommerce_wrappers(){

remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );

remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_output_content_wrapper', 10);

remove_action( 'woocommerce_after_shop_loop', 'woocommerce_output_content_wrapper_end', 10);

add_action( 'woocommerce_before_main_content', 'custom_open_woocommerce_content_wrappers', 10 );

add_action( 'woocommerce_after_main_content', 'custom_close_woocommerce_content_wrappers', 10 );

add_action( 'woocommerce_before_shop_loop', 'custom_product_wrapper_open', 10 );

add_action( 'woocommerce_after_shop_loop', 'custom_product_wrapper_close', 10 );

}

}

add_action( 'wp_head', 'custom_prepare_woocommerce_wrappers' );

这将创建一个带右侧边栏的包装器 . 如果需要,您可以进一步自定义 . 希望能帮助到你 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值