我假设你有函数。主题目录中的php文件,然后可以添加以下代码:
/*Section for enqueuing styles and scripts*/
function keyword_theme_styles_and_scripts(){
/* Styles Below */
wp_enqueue_style(\'bootstrap-min-css\', \'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\');
wp_enqueue_style(\'video-js-min-css\', get_template_directory_uri().\'/assets/css/video-js.min.css\');
wp_enqueue_style(\'google-fonts\', \'https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800\');
wp_enqueue_style(\'font-awesome-min-css\', get_template_directory_uri().\'/assets/font-awesome/css/font-awesome.min.css\');
wp_enqueue_style(\'magnific-popup-css\', get_template_directory_uri().\'/assets/css/magnific-popup.css\');
wp_enqueue_style(\'animate-min-css\', get_template_directory_uri().\'/assets/css/animate.min.css\');
wp_enqueue_style(\'device-mockups-min-css\', get_template_directory_uri().\'/assets/device-mockups/device-mockups.min.css\');
wp_enqueue_style(\'main-css\', get_template_directory_uri().\'/style.css\');
/* Scripts Below */
wp_enqueue_script(\'jquery-min-js\', get_template_directory_uri().\'/assets/js/jquery.min.js\', array(), \'\', true);
wp_enqueue_script(\'video-min-js\', get_template_directory_uri().\'/assets/js/video.min.js\', array(\'jquery-min-js\'), \'\', true);
wp_enqueue_script(\'bootstrap-min-js\', \'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\', array(\'jquery\'), \'\', true);
//wp_enqueue_script(\'bootstrap-min-js\', get_template_directory_uri().\'assets/bootstrap/js/bootstrap.min.js\', array(\'jquery-min-js\'), \'\', true);
wp_enqueue_script(\'jquery-easing-min-js\', \'https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js\', array(\'jquery-min-js\'), \'\', true);
wp_enqueue_script(\'scrollreveal-min-js\', get_template_directory_uri().\'/assets/js/scrollreveal.min.js\', array(\'jquery-min-js\'), \'\',true);
wp_enqueue_script(\'jquery-magnific-popup-min-js\', get_template_directory_uri().\'/assets/js/jquery.magnific-popup.min.js\',array(\'jquery-min-js\'), \'\', true);
wp_enqueue_script(\'svg-injector-min-js\', get_template_directory_uri().\'/assets/js/svg-injector.min.js\', array(\'jquery-min-js\'), \'\', true);
wp_enqueue_script(\'wow-min-js\', get_template_directory_uri().\'/assets/js/wow.min.js\', array(\'jquery-min-js\'), \'\', true);
wp_enqueue_script(\'index-min-js\', get_template_directory_uri().\'/assets/js/index.min.js\', array(\'jquery-min-js\'), \'\', true);
}
add_action(\'wp_enqueue_scripts\', \'keyword_theme_styles_and_scripts\');
请记住将自定义样式和脚本排在队列底部。
脚本和样式的顺序也很重要,所以请按适当的顺序排队。
我希望这有帮助。
祝你好运