How to change value stylesheet_url in wordpress?

社会主义新天地 提交于 2019-12-11 07:53:47

问题


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.

<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?


回答1:


you can put new css file path like this:

<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 ;)




回答2:


In function blog_info().

Here is the link to do this and also check this link and this.

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



来源:https://stackoverflow.com/questions/12448779/how-to-change-value-stylesheet-url-in-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!