wp_enqueue_script was called incorrectly. Scripts and styles

Of course I’m unable to answer you exactly, because I don’t see a full functions.php code. You can use wp_enqueue_scripts action hook with both, scripts and styles. Do not call wp_enqueue_script and wp_enqueue_style outside of wp_enqueue_scripts hook. add_action(‘wp_enqueue_scripts’, ‘wp_enqueue_scripts_callback’); function wp_enqueue_scripts_callback(){ wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘thickbox’ ); wp_enqueue_script( ‘media-upload’ ); wp_enqueue_script(‘smoothscroll’, get_bloginfo(‘stylesheet_directory’).’/includes/js/smoothscroll.js’, array(‘jquery’), ”); wp_enqueue_script(‘marker’, … Read more

wordpress enqueue script not working

You only register your first script, but don’t enqueue it. Change wp_register_script to wp_enqueue_script and it should work. Registering it is useful if you may possibly enqueue it at different times/conditions, but in this case you can just enqueue it straight away.

Dynamic wp_enqueue_scripts?

You could use anonymous functions in PHP 5.3+ to do this. <?php function addThemeJS($enqueueThemeJS, $handle, $src, $deps, $ver, $in_footer) { add_action(‘wp_enqueue_scripts’, function() use ($handle, $src, $deps, $ver, $in_footer) { wp_enqueue_script($handle, $src, $deps, $ver, $in_footer); }); } If you’re using this a personal project where you know the server has 5.3+ you would be okay if … Read more

How do I pass $in_foooter to wp_enqueue_script() without passing other params?

Try passing array() for $deps, and NULL for $ver: wp_enqueue_script( $handle, $src, array(), NULL, $in_footer); Or, using your function call: wp_enqueue_script(“myscript” , get_template_directory_uri().”/js/myscript.js”, array(), NULL, true ); By the way, passing the script itself as a dependency to itself will probably make something blow up. Note also: if your script depends on jQuery, just pass … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)