The other answer confuses the function with the action hook. There is nothing wrong with using the
wp_print_styles() function to print a stylesheet link, as long as you've already registered/enqueued the stylesheet and know its handle.
(Fun fact: it's the function WP uses under the hood to output the enqueued stylesheets during
The guidance on the core blog and in the Trac ticket advises against using the
wp_print_styles hook to enqueue a stylesheet. In WP 3.3, this might have caused your custom stylesheet to load in the admin area, but this was fixed. Regardless, it's still the wrong hook for registering or enqueuing stylesheets, since it fires during the
Generally, you should use
wp_enqueue_style() since it handles registration & enqueueing (and, as a result, printing the link as part of
wp_head). All-in-one simplicity.
However, if you need total control over where the stylesheet link is placed (say it needs to go in a specific template part, or wrapped inside
wp_print_styles() is the right function to use.
Here's an example of how you might use them all:
wp_enqueue_style( 'main-styles', 'main.css' );
// registers the handle, but does not add it to the print queue.
wp_register_style( 'noscript-styles', 'noscript.css' );
add_action( 'wp_enqueue_scripts', 'addMainStylesheet' );
add_action( 'wp_enqueue_scripts', 'registerNoscriptStylesheet' );
// Fire the `wp_head` hook, which prints the link for main.css
// Now we'll print the handle we registered earlier
wp_print_styles( 'noscript-styles' );
I'd recommend this question for more about the difference between
Why wp_register_style() is important while I'm using a complete wp_enqueue_style()?