How to add external remote JS source to Gravity Forms?

I think you’re looking for gform_enqueue_scripts which is simply a Gravity Forms specific version of the wp_enqueue_scripts hook. Either hook uses the wp_enqueue_script() function. That function can take a local script—usually using get_template_directory_uri() (theme), get_stylesheet_directory_uri() child theme), or plugins_url() (plugin) to reference the file location—or an external location like what you’re trying to do. You’d … Read more

add jquery file if a certain page is included

While you can approach it with “what template is loaded”, WP isn’t engineered for such logic. Template load is result of logic processing, not the other way around. You should check out Conditional Tags and determine which logical check applies to your situation. Other than that you should be: running script-related logic on appropriate wp_enqueue_scripts … Read more

Ajaxurl suddenly not defined

take a look here: http://codex.wordpress.org/Function_Reference/wp_localize_script First add Data in your php file // Register the script first. wp_register_script( ‘some_handle’, ‘path/to/myscript.js’ ); // Now we can localize the script with our data. $translation_array = array( ‘some_string’ => __( ‘Some string to translate’ ), ‘a_value’ => ’10’ ); wp_localize_script( ‘some_handle’, ‘object_name’, $translation_array ); // The script can … Read more

Linking Javascript in functions.php file

So this looks like you’re using a JS package manager, possibly Dustin Diaz’s ScriptJS? And I’m assuming you are storing all these files within your theme folder it would then be just a matter of linking to your script.min.js file via the wp_enqueue_script mechanism as follows: function wpse143251_enqueue_theme_scripts() { wp_enqueue_script( ‘dustindiaz-scriptjs’, get_template_directory_uri() . ‘/assets/components/plugins/ajaxify/script.min.js?v=v1.9.6&sv=v0.0.1’ ); … Read more