[theme-reviewers] wp_enqueue_style for style.css?

Nicolas Kuttler theme-reviewers at nicolaskuttler.de
Sun Jul 11 08:58:41 UTC 2010

On Sun, Jul 11, 2010 at 04:33:27AM -0400, Andrew Nacin wrote:
> theme and it's only a waste of cycles to register and enqueue it. On the
> other hand, after thinking about this some more, if they are all enqueued,
> then a plugin could scoop them up and concatenate them.

Another benefit would be that wp_enqueue_script() can add a proper version parameter to the style.css that refreshes cached versions of the file.

My own base theme uses this atm (which is far from optimal... need to fix)

if ( !is_admin() ) { 
    $data = get_theme_data( dirname( __FILE__ ) . '/style.css' );
    wp_register_style( 'mwfw', get_bloginfo( 'stylesheet_url' ), false, $data['Version'] );
    wp_enqueue_style( 'mwfw' );


Nicolas Kuttler
wp at nkuttler.de

http://www.nicolaskuttler.de (deutsch)

More information about the theme-reviewers mailing list