How to change value stylesheet_url in wordpress?

2019-07-23 15:01发布

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?

2条回答
Explosion°爆炸
2楼-- · 2019-07-23 15:42

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

查看更多
看我几分像从前
3楼-- · 2019-07-23 15:52

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.

查看更多
登录 后发表回答