How to change WordPress’ stylesheet URL with add_filter(). Just a quicky: To change the stylesheet URL in WordPress, to offload static content, put the following in your theme’s functions.php file:

Change WordPress stylesheet_uri with add_filter() Click To Tweet
add_filter('stylesheet_uri', 'saotn_change_css');
function saotn_change_css() {
  return "//css.example.com/wp-content/themes/[theme name]/style.css";
}

Now your theme’s style.css will be loaded from a sub domain -or hostheader- called css.example.com. This can improve overall website performance.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *