Everywhere is said that you need to use wp_enqueue_scripts() instead of wp_print_styles(). wp_print_styles() is located in wp-includes/functions.wp-styles.php.

So what does it mean? What should I change? Where? Why? Can it compromise my theme?

  • 2
    It depends on what you want to do. I you can post more details of the use you are doing of wp_prit_styles we can tell you if you should change something or not. – cybmeta May 16 '15 at 8:33
  • My problem is simply that some css are not rendered. In the console they appear inline but they are not, so I guess it's because it's ouput directly to the browser via wp_print_styles. – Criss May 17 '15 at 7:27

In short, as of WordPress 3.3 use wp_enqueue_scripts to load JS and CSS. wp_print_styles has/had some minor bugs with it (namely, it may include your scripts in the admin as well) - here and here are some more details on all of that. It doesn't sound like there's any major security flaws or theme breaking here, just better practice to use wp_enqueue_scripts.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.