我是靠谱客的博主 简单鸭子,这篇文章主要介绍wordpress外部调用到html,如何链接外部css在wordpress?,现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(107)

评论列表共有 0 条评论

立即
投稿
返回
顶部