【问题标题】:Hide woocommerce storefront handheld footer on cart, checkout, and account在购物车、结帐和帐户上隐藏 woocommerce 店面手持页脚
【发布时间】:2018-05-08 23:37:13
【问题描述】:

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

【问题讨论】:

    标签: php css wordpress woocommerce storefront


    【解决方案1】:

    你可以试试这样的: 如果您还没有一个名为 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');
    }
    

    【讨论】:

    • 好的,我试了一下,但没有成功。唯一影响这一点的是直接更改 assets/sass/woocommerce 文件夹中的店面 woocommerce css。仍在尝试一些选项,但到目前为止还没有骰子。
    猜你喜欢
    • 1970-01-01
    • 2018-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-17
    • 2013-12-13
    • 2021-08-14
    • 1970-01-01
    相关资源
    最近更新 更多