我正在尝试隐藏购物车、页脚和帐户页面上的 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 );
}
}