首页 > 解决方案 > 如何在 woocommerce 中覆盖父 style.css?Function.php文件问题

问题描述

这就是困扰我的地方。

这是我的functions.php:

<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'avada-stylesheet','avada- max-2c','avada-min-2c-max-3c','avada-min-3c-max-4c','avada-min-4c-max-5c','avada-min-5c-max-6c','avada-min-768-max-1024-p','avada-min-768-max-1024-l','avada-max-shbp-18','avada-max-shbp-32','avada-max-640','avada-min-768-max-1024-woo' ) );
}
endif;

add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );    

if ( !function_exists( 'child_theme_configurator_css' ) ):
function child_theme_configurator_css() {
wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'chld_thm_cfg_parent' ) );
    }
endif;

add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 20 );

// END ENQUEUE PARENT ACTION

这是我的子主题中的 style.css 文件:

/*
Theme Name: Avada Child
Theme URI: http://avada.theme-fusion.com/
Template: Avada
Author: ThemeFusion
Author URI: http://themeforest.net/user/ThemeFusion
Description: The #1 selling theme of all time that allows you to build virtually any     design style.
Version: 5.7.2.1545428017
Updated: 2018-12-21 22:33:37

*/


.woocommerce-message {

padding-left: 18px;
background-color: #252a33;
border-top: 1px solid rgba(128,128,128,1);
border-top-color: rgb(128, 128, 128);
border-bottom: 1px solid rgba(128,128,128,1);
border-bottom-color: rgb(128, 128, 128);
color: rgba(128,128,128,1);

}

我的目标是更改背景颜色,但它不起作用......我使用 Child Theme Configurator 插件制作了一个子主题,我认为该插件负责 function.php 的外观......

请帮忙。

保罗

标签: phpcsswordpress

解决方案


推荐阅读