wp_register_script was called incorrectly file location
wp_register_script was called incorrectly file location
wp_register_script was called incorrectly file location
I assume these are child theme scripts because of your function name: twentyfourteen_child_scripts() When loading scripts from your child themes functions file you should use: wp_enqueue_script( ‘$handle’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/filename.js’, array( ‘jquery’ ), ‘1.0.0’ ); Or use add_action( ‘wp_enqueue_scripts’, ‘child_add_modernizr_scripts’ ); function child_add_modernizr_scripts() { wp_register_script(‘modernizr’, get_stylesheet_directory_uri() . ‘/js/modernizr.js’, false, ‘1.0’, true ); wp_enqueue_script( … Read more
Well, you have to call wp_licalize_script after registering the script, because you need handle of that script… And of course you can’t localize something that doesn’t exist… Here’s some example: if ( !function_exists(‘pt_scripts’) ): function pt_scripts () { wp_register_style( ‘style’, get_stylesheet_uri(), null, ‘1.3.1’, ‘all’ ); wp_enqueue_style( ‘style’ ); wp_register_script( ‘scripts’, get_template_directory_uri() . ‘/script.js’, array(‘jquery’), ‘1.3.0’, … Read more
Simply pass in null or the empty equivalent. For example, if you don’t depend on anything, say so. It’s expecting an array of the dependencies, so pass an empty array array() Or pass in null
You need to hook your function into either wp_enqueue_scripts, admin_enqueue_scripts, or init. wp_footer is too late to enqueue scripts; they need to be enqueued before the wp_head() function is called. The fifth argument of the wp_enqueue_scripts() function, when set to true, will load the script in the page footer instead of header. From the Codex: … Read more
I think you have to pass NULL as the 4th parameter. wp_register_script( ‘myscript’, get_bloginfo(‘template_directory’).’/scripts.myversionnumber.js’, false, NULL, true); wp_enqueue_script(‘myscript’);