Avada自定义CSS设置未生效

时间:2018-08-24 10:16:57

标签: wordpress

我遇到了各种各样的错误,标题图像未更改,自定义css(由avada或子主题制作)没有任何效果。我在Wordpress(版本4.9.8)上全新安装了Avada(5.6.2),并且在进行小的更改时,各种东西已经出错了。我托管在wpengine上。

如何解决此问题?这是缓存问题还是服务器还是其他问题?

1 个答案:

答案 0 :(得分:2)

以下两个设置是否正确?

子项中的Style.css:

/*
 Theme Name:   Twenty Fifteen Child
 Theme URI:    http://example.com/twenty-fifteen-child/
 Description:  Twenty Fifteen Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     twentyfifteen
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fifteen-child
*/

子项中的Functions.php:

<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}
?>

来自:https://codex.wordpress.org/Child_Themes

然后您将要使用的样式表排队了吗?

<?php
function my_theme_enqueue_styles() {

    $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),
        wp_get_theme()->get('Version')
    );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>