JavaScript file successfully registered but does not render correctly

You were using action to enqueue script, instead you need to use filter hook. As, you are adding a new script to the scripts call. However, if you used action hook for the wp_head call it works there. <?php add_filter(‘wp_enqueue_scripts’, ‘colorboxJS’); function colorboxJS() { wp_enqueue_script( ‘colorbox’, get_stylesheet_directory_uri() . ‘/colorboxJSfile.js’, array(‘jquery’) ); } ?>

Adding Gravity Form With if(is_page) Is Not Working

if you got following in your functions.php function add_split_test_forms() { if (is_page(‘Homepage’)): gravity_form(19, false, false, false, ”, false); endif; } you will at least need to run this function once: add a line add_split_test_forms() in your functions.php. if your condition if (is_page(‘Homepage’)): is correct. (I prefer if ( is_front_page()): should also work.) Then your form … Read more

PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered

Before you can use, those two lines : wp_enqueue_style( ‘wp-auth-check’ ); wp_enqueue_script( ‘wp-auth-check’ ); you should register those assets, inside wp_enqueue_scripts or admin_enqueue_scripts, like the following : function my_assets() { wp_register_style( ‘wp-auth-check’, ‘path/to/style’, $deps = array, $ver = false, $media=”all” ) wp_register_script( ‘wp-auth-check’, ‘path/to/your-script’, $deps = array, $ver = false, $in_footer = false ) } … Read more

Bootstrap 4 Optimization

You just make a big mistake. use this guideline. header.php <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css” integrity=”sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm” crossorigin=”anonymous”> You also made a mistake calling js file. Frist needs jQuery then popper.js then bootstrap and the big mistake is you call all of them in the header file, that’s why when the page is loaded it takes time to … Read more

convertEntities() used before it is defined

The convertEntities function was defined in utils.js, but if you use script concatenation this file would be included after it is needed. Because it was in a try-catch clause, the error was not (always) noticed. The solution is to include the convertEntities function before this code is loaded. In WordPress 3.1 this is now included … Read more

How to Run a jQuery Script after a Javascript Script has Finished in WordPress

To accomplish this, wrap wp_enqueue_script in a function and run it through the action hook wp_enqueue_scripts while using the ‘priority’ parameter available in add_action to set the load order. function these_go_first() { wp_enqueue_script(‘first_script’, ‘[path to file]/first.js’, array(‘jquery’), ‘1.0’ ); } function these_go_first() { wp_enqueue_script(‘after_script’, ‘[path to file]/after.js’, array(‘jquery’, ‘first_script’), ‘1.0’ ); } add_action(‘wp_enqueue_scripts’, ‘these_go_first’, 1); … Read more

Why does this fail: Disabling plugins enqueue_script() in functions.php

You have two issues here: Conditional tags (is_single()) should not be used so early in functions.php. Your removal function is getting hooked to run after function it’s meant to remove. It should be something like this: function remove_shc() { if ( is_single( array( 17, 19, 1, 11 ) ) ) remove_action( ‘wp_print_scripts’, ‘wp_shc_head_scripts’ ); } … Read more

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