zoukankan      html  css  js  c++  java
  • Wordpress 删除 Storefront 主题的购物车

    1. 修改PHP,找到 theme 下functions.php文件,添加以下代码

    1. Log into your WordPress site and access the Dashboard as the admin user.
    2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will disable the cart icon in the storefront theme.
    3. Add the following code to the php file:
    /**
    
     * Disable Cart Icon
    
      */
    
    function remove_sf_actions() {
    
        remove_action( 'storefront_header', 'storefront_header_cart', 60 );
    
    }
    
    add_action( 'init', 'remove_sf_actions' );

    2. 修改CSS

    检查元素定位到购物车,将display属性改为none, 并将下列代码粘贴到 Additional CSS中。

    .site-header-cart .cart-contents {
        padding: 1.618em 0;
        display: none;
        position: relative;
        background-color: rgba(0,0,0,0);
        height: auto;
        width: auto;
        text-indent: 0;
    }

    Adding the Rule

    The remaining part is to copy/paste into the “Additional CSS” section of your Storefront theme customization interface. To do this:

    • Log into your WordPress site and access the Dashboard as the admin user.
    • From the Dashboard menu, click on Appearance Menu > Customize.
    • Navigate down to Additional CSS in the left sidebar that appears.
  • 相关阅读:
    CentOS 配置epel源
    phpstudy + dvws
    被动信息收集
    Mysql 通过information_schema爆库,爆表,爆字段
    油猴百度云
    浏览器如何弹出下载框
    Ubuntu更新源
    关于cookie
    monitor
    分享一个自制的计算子网划分的小工具
  • 原文地址:https://www.cnblogs.com/jilili/p/14502702.html
Copyright © 2011-2022 走看看