我想编辑这些css链接,但我在header.php中找不到它们(它们应该在那里),它们来自哪里?
rel='stylesheet' id='js_composer_front-css' href='//metasyfe.com/wp-content/plugins/js_composer/assets/css/js_composer.css' type='text/css' media='all' /><link
rel='stylesheet' id='bootstrap-css' href='//metasyfe.com/wp-content/themes/startuply/css/lib/bootstrap.min.css' type='text/css' media='all' /><link
rel='stylesheet' id='startuply_custom-css' href='//metasyfe.com/wp-content/themes/startuply/style.css' type='text/css' media='all' /><link
rel='stylesheet' id='startuply_ptsans-css' href='//fonts.googleapis.com/css?family=PT+Sans%3A400%2C700%2C400italic%2C700italic&subset=latin%2Ccyrillic-ext%2Clatin-ext%2Ccyrillic' type='text/css' media='all' /><link
rel='stylesheet' id='startuply_lato-css' href='//fonts.googleapis.com/css?family=Lato%3A100%2C300%2C400%2C700%2C900%2C100italic%2C300italic%2C400italic%2C700italic%2C900italic' type='text/css' media='all' /><link
rel='stylesheet' id='vsc-animation-style-css' href='//metasyfe.com/wp-content/themes/startuply/engine/extend/animations/css/vivaco-animations.css' type='text/css' media='all' /><script type='text/javascript' src='//metasyfe.com/wp-includes/js/jquery/jquery.js' defer='defer'></script><script type='text/javascript' src='//metasyfe.com/wp-includes/js/jquery/jquery-migrate.min.js' defer='defer'></script><script type='text/javascript' src='//metasyfe.com/wp-content/themes/startuply/engine/extend/animations/js/vivaco-animations.js' defer='defer'></script><link
rel="EditURI" type="application/rsd+xml" title="RSD" href="//metasyfe.com/xmlrpc.php?rsd" /><link
rel="wlwmanifest" type="application/wlwmanifest+xml" href="//metasyfe.com/wp-includes/wlwmanifest.xml" /><meta
name="generator" content="WordPress 4.3.1" /><link
答案 0 :(得分:1)
WordPress使用wp_enqueue_style
和wp_enqueue_script
将CSS / JS文件添加到标题中。
您提到的某些文件来自插件,而其他文件来自您的wp-content/themes/startuply/functions.php
文件。
<强>更新强>
这是一个如何将 JS 排入header
的示例:
wp_register_script('script', get_template_directory_uri() . '/js/scriptname.js', array('jquery'), '1.0.0', true); // Custom scripts
wp_enqueue_script('script'); // Enqueue it!
这是将 CSS :
排入队列wp_register_style('normalize', get_template_directory_uri() . '/normalize.css', array(), '1.0', 'all');
wp_enqueue_style('normalize'); // Enqueue it!
您可以在这里阅读更多内容
https://codex.wordpress.org/Function_Reference/wp_enqueue_style
https://codex.wordpress.org/Function_Reference/wp_enqueue_script