在购物车,结帐和帐户上隐藏woocommerce店面手持页脚

时间:2017-11-25 02:03:18

标签: php css wordpress woocommerce storefront

我正在尝试隐藏购物车,页脚和帐户页面上的Storefront手持页脚栏。我是Wordpress和Woocommerce编码的新手,编码以下内容并没有任何效果。以下是我的3次尝试我做错了什么?任何帮助将不胜感激。

add_action('wp_head','noshowHHFCSS');
function noshowHHFCSS() {
echo '<style>
/* Do not show hand held footer bar on cart, check out and account page*/
.page-id-5 .page-id-6 .page-id-7 .storefront-handheld-footer-bar  {
display: none!important;
}
</style>';
} 


if ( is_cart() || is_checkout() || is_account_page() ) { 
echo '<style>
/* Do not show hand held footer bar on cart, check out and account page*/
.storefront-handheld-footer-bar  {
display: none!important;
}
</style>';
} 


add_action( 'init', 'jk_remove_storefront_handheld_footer_bar' );
if ( is_cart() || is_checkout() || is_account_page() ) {
function jk_remove_storefront_handheld_footer_bar() {
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 );
}
}

1 个答案:

答案 0 :(得分:0)

您可以尝试这样的事情: 如果您还没有一个名为CSS的新文件夹,请在根主题文件夹中创建。之后,创建一个包含页脚样式代码的customFooterStyle.css文件。

function.php这个代码:

function footerBarStyle() {
  wp_enqueue_style( 'custom_footer_css', get_template_directory_uri() . '/css/customFooterStyle.css' );
} 
if(is_cart() || is_checkout() || is_account_page() ){
    add_action('wp_enqueue_scripts', 'footerBarStyle');
}