CSS 如何更改wordpress中的值stylesheet_url?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12448779/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 20:10:18  来源:igfitidea点击:

How to change value stylesheet_url in wordpress?

csswordpressurlstylesheet

提问by Tom

I'm trying to modify a theme in wordpress and one thing I've stumbled upon is the way this theme is including a stylesheet file.

我正在尝试修改 wordpress 中的主题,我偶然发现的一件事是该主题包含样式表文件的方式。

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

As I discovered stylesheet_url refers to the file named style.css in the root folder. How can I change the value of the stylesheet_url so that my stylesheet file in the css/ directory will be loaded instead of the default one?

我发现 stylesheet_url 指的是根文件夹中名为 style.css 的文件。如何更改 stylesheet_url 的值,以便加载 css/ 目录中的样式表文件而不是默认文件?

回答by Lalit Kaushik

you can put new css file path like this:

你可以像这样放置新的css文件路径:

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('template_directory'); ?>/css/newstyle.css" />  

and you can remove default css path if you don't need. hope this helps you. All the best ;)

如果不需要,您可以删除默认的 css 路径。希望这对你有帮助。祝一切顺利 ;)

回答by NullPoiиteя

In function blog_info().

在功能上blog_info()

Here is the link to do thisand also check this linkand this.

这是执行此操作链接,并检查此链接.

You can also see an example here: Where is the value for Wordpress bloginfo('stylesheet_url') saved.

您还可以在此处查看示例:Wordpress bloginfo('stylesheet_url') 保存的值在哪里