• When running WP_DEBUG I am getting this error:

    Notice: wp_register_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.) in /homepages/21/d346982127/htdocs/wordpress/wp-includes/functions.php on line 3245

    Of course line 3245 of wp-includes/functions.php is not where the error resides, that’s just the code to tell me I’m doing it wrong haha.

    The result of this is when publishing a new product or editing an existing product (woo commerce plugin) I get the white screen of death. Though it writes to the database just fine.

    Here’s where I think it’s coming from:

    add_action('admin_enqueue_scripts', 'wp_enqueue_media');
    
    function load_theme_scripts() {
    	wp_enqueue_script( 'jquery' );
    	wp_enqueue_script('superfish', get_bloginfo('stylesheet_directory') . '/js/superfish.js', array('jquery')	);
    	wp_enqueue_style( 'superfishcss', get_stylesheet_directory_uri().( '/js/superfish.css'), false, 1, false );
    	wp_enqueue_script('hoverIntent', get_bloginfo('stylesheet_directory') . '/js/hoverIntent.js', array('jquery'));
    
    	wp_register_style('googleFontsdancingscript','https://fonts.googleapis.com/css?family=Dancing+Script');
        wp_enqueue_style( 'googleFontsdancingscript');
    
    	wp_register_style('googleFontsOpensans','https://fonts.googleapis.com/css?family=Open+Sans');
        wp_enqueue_style( 'googleFontsOpensans'); 
    
        //Nivo slider
    	wp_enqueue_script('nivoslider', get_bloginfo('stylesheet_directory') . '/js/nivo-slider/jquery.nivo.slider.js', array('jquery'));
    	//wp_enqueue_style( 'nivoslidercss', get_stylesheet_directory_uri().( '/js/nivo-slider/themes/default.css'), false, 1, false );
    	wp_enqueue_style( 'nivoslidercss', get_stylesheet_directory_uri().( '/js/nivo-slider/nivo-slider.css'), false, 1, false );
    }
    
    wp_register_style( 'custom_wp_admin_css', get_bloginfo( 'stylesheet_directory' ) . '/admin-style.css', false, '1.0.0' );
    
    add_action('wp_enqueue_scripts', 'load_theme_scripts');
    add_action('admin_enqueue_scripts', 'load_admin_scripts');

    Thoughts? Thank you for your help!

  • The topic ‘Debugging Issue’ is closed to new replies.