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.
  • 相关阅读:
    前端工具Rythem介绍
    Redis持久化————AOF与RDB模式
    Hessian——轻量级远程调用方案
    JavaScript中的类数组对象
    在SpringMVC中获取request对象
    linux下,远程连接mysql
    nohup后台运行jar与关闭
    Vi常用命令
    spring mvc 重定向问题
    eclipse修改jdk后版本冲突问题
  • 原文地址:https://www.cnblogs.com/jilili/p/14502702.html
Copyright © 2011-2022 走看看