wpalchemy icon indicating copy to clipboard operation
wpalchemy copied to clipboard

Problem with header information on WP 3.3.1

Open Harrisonbro opened this issue 13 years ago • 1 comments

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

Harrisonbro avatar Jan 09 '12 15:01 Harrisonbro

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' );
    }
}

farinspace avatar Jan 09 '12 17:01 farinspace