How to change value stylesheet_url in wordpress?

2019-07-23 15:24发布

问题:

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.