Wordpress问题汇总

1、enfold主题在Theme Editor中自定义css无效?

短暂解决方法:这是由于缓存导致的,在Theme Options-Performance中关闭再打开css压缩即可让enfold重新压缩变动的css文件

永久解决方法:在Theme Editor-Theme Functions (functions,php)中增加以下代码

/*    
* Load Style.css file of child theme after minification so it overrides minification scripts 
*
* Related thread: https://kriesi.at/support/topic/add-style-css-from-child-to-merge-files/
*
*/ 

/* Dequeue Style.css file of child theme */ 
add_action( 'wp_enqueue_scripts', 'av_dequeue_child_stylecss', 20 );
function av_dequeue_child_stylecss() {
    if(is_child_theme()){
        wp_dequeue_style( 'avia-style' );
    }
}

/* Enqueue Style.css after minification scripts */ 
add_action( 'wp_enqueue_scripts', 'av_reenqueue_child_stylecss', 9999999 );
function av_reenqueue_child_stylecss() 
{
    if (is_child_theme()){
        wp_enqueue_style( 'avia-style', get_stylesheet_uri(), true, filemtime( get_stylesheet_directory() . '/style.css' ), 'all');
    }
}
 参考链接: https://kriesi.at/support/topic/enfold-child-style-css-not-working/
 
 
 
 
 
 
 
 
 
×
拖拽到此处
图片将完成下载

猜你喜欢

转载自www.cnblogs.com/dashanshan/p/12681934.html