概述
The theme i'm using supports only one primary header menu. I'm trying to make another one using another one using external css . How can i link external css in wordpress theme.
解决方案
Your best option would be to enqueue the file onto the page you want.
In the functions.php file, add this code
// Register style sheet.
add_action( 'wp_enqueue_scripts', 'register_custom_plugin_styles' );
/**
* Register style sheet.
*/
function register_custom_plugin_styles() {
wp_register_style( 'my-stylesheet', 'STYLESHEETS URL' );
wp_enqueue_style( 'my-stylesheet' );
}
If you only want this on specific pages, then you'll need to put it round an if statement checking what page you are currently on to know if to run the above script.
最后
以上就是简单鸭子为你收集整理的wordpress外部调用到html,如何链接外部css在wordpress?的全部内容,希望文章能够帮你解决wordpress外部调用到html,如何链接外部css在wordpress?所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复