// adding the CSS and JS files
function gt_setup(){
wp_enqueue_style('google-fonts', '//fonts.googleapis.com/css?family=Roboto|Roboto+Condensed|Roboto+Slab');
wp_enqueue_style('fontawesome', '//href="font-awesome-4.7.0/css/font-awesome.min.css');
wp_enqueue_style('style', get_stylesheet_uri('style.css'), NULL, microtime(), all);
wp_enqueue_script("main", get_theme_file_uri('/js/main.js' ), NULL, microtime(), true);
}
add_action('wp_enqueue_scripts', 'gt_setup');
?>发布于 2020-07-25 05:27:58
这是一个有效的错误...
所以我去谷歌,输入wp_enqueue_style来检查功能,结果显示...
wp_enqueue_style( string $handle, string $src = '', string[] $deps = array(), string|bool|null $ver = false, string $media = 'all' )这意味着all是一个有效的参数值,但是您没有通过用单引号(或双引号)将其括起来来将其定义为字符串。
PHP将all 视为一个常量,但找不到它,因此出现了错误。
PHP将'all' 视为字符串,在本例中是一个有效的参数值。
https://stackoverflow.com/questions/63081611
复制相似问题