farinspace / wpalchemy

Thin framework for wordpress
http://wpalchemy.com/
Other
416 stars 110 forks source link

Problem with header information on WP 3.3.1 #38

Open Harrisonbro opened 12 years ago

Harrisonbro commented 12 years ago

Just tried to use wpAlchemy on a site running wp3.3.1 and when trying to save or update a post I get the following messages:

Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /_my_root_path_/wp-includes/functions.php on line 3587

Warning: Cannot modify header information - headers already sent by (output started at /_my_root_path_/wp-includes/functions.php:3587) in /_my_root_path_/wp-includes/pluggable.php on line 866```

Any suggestions would be great! Very happy to try things out if that helps.

Cheers, Harrison

farinspace commented 12 years ago

this isn't an issue with wpalchemy exactly ... its how the css is initially included, this has been updated on the main site documentation, try:

// include css to help style our custom meta boxes
add_action( 'init', 'my_metabox_styles' );

function my_metabox_styles()
{
    if ( is_admin() ) 
    { 
        wp_enqueue_style( 'wpalchemy-metabox', get_stylesheet_directory_uri() . '/metaboxes/meta.css' );
    }
}