Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've just uploaded a new, custom theme to find that the container is a fraction of the intended width, and the sections below the home section(this is one single page, long site utilizing ids/anchors to navigate) are no longer showing. I turned on DEBUG to see if I could spot the problem, and after deactivating problematic plugins, I'm left with this error:

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 /home/achenn/public_html/frshstudio.com/wp-includes/functions.php on line 2959

Problem is, the only thing on that particular line is:

trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );

I've seen other blog posts and forums, but the line they are telling me to search for is non-existent in this file, much less on the given line.

Any tips, ideas, etc on how to remedy this challenge are greatly appreciated.

phrase in question is not in file

Live site.

share|improve this question
    
I bet it has something to do with the error at the top of the page: 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 /home/achenn/public_html/frshstudio.com/wp-includes/functions.php on line 2959 Of course, turning the maint. mode plugin off might help as well...:) –  jfacemyer Feb 28 '13 at 4:46
    
@jfacemyer Yeah, I just noticed that error as well. Maint Mode is now off(thought, I did that before, sorry). I turned off all plugins causing trouble, and am left with the error you mentioned. Problem is, I can't find that line of code anywhere, much less in the specified file on the specified line. –  user1255049 Feb 28 '13 at 4:58
    
grep your theme and plugin directories for wp_enqueue_script. It can't be that hard to find. –  s_ha_dum Feb 28 '13 at 5:22
    
@s_ha_dum as mentioned below, scanned a few files and did a specific search for wp_enqueue_style and enqueue, nothing found. –  user1255049 Feb 28 '13 at 5:32
1  
Don't "scan a few files". Search the whole wp-content directory. Given that the error references wp_enqueue_style, it has to be there. The problem is not in /wp-includes/functions.php. Sometimes the error messages mislead. –  s_ha_dum Feb 28 '13 at 5:37

1 Answer 1

In other words, you should not perform a wp_enqueue_style which is not hooked to wp_enqueue_script.

Your wp_enqueue_style should be in a function, and you should hook that function to wp_enqueue_scripts like in the following example:

function wpse88755_enqueue(){
  # call  wp_enqueue_style here
}

#hook the function to wp_enqueue_scripts
add_action( 'wp_enqueue_scripts', 'wpse88755_enqueue' );
share|improve this answer
    
I understand the concept, and I appreciate your time and answer. My problem is, I can't find wp_enqueue_style in any of my wp-includes files. –  user1255049 Feb 28 '13 at 5:22
    
You should check it in your theme folder. It is the notice that is being triggered from /wp-includes/functions.php. This folder contains core WordPress files. –  RRikesh Feb 28 '13 at 5:24
    
Checked that file, did a specific search for wp_enqueue_style and enqueue, nothing found. –  user1255049 Feb 28 '13 at 5:31
    
which file you checked? Check the folder of you current theme - wp-content/themes/your-theme –  RRikesh Feb 28 '13 at 6:21
    
I've checked EVERY file in my current theme folder, EVERY file in wp-includes(found wp_enqueue_style in class-wp-admin-bar.php, class-wp-customize-control.php, class-wp-editor.php, functions.wp-styles.php, general-template.php, and media.php BUT nothing looked out of the ordinary, and I don't know how to proceed further with checking. I appreciate your efforts with this. –  user1255049 Feb 28 '13 at 14:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.