Answer the question
In order to leave comments, you need to log in
What is this error on Wordpress + Woocommerce site and how to fix it?
Hello.
Added new functionality to the site through the theme file functions.php
Decided to check it out. Turned
it on and got this notification:define('WP_DEBUG', true);
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 login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /public_html/wp-includes/functions.php on line 4773 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 login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /public_html/wp-includes/functions.php on line 4773
Answer the question
In order to leave comments, you need to log in
Hello.
Place the call to the wp_enqueue_style function in the wp_enqueue_scripts hook .
Example:
add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
function theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question