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内容请搜索靠谱客的其他文章。
发表评论 取消回复