How to give path to files in plugins folder?

I’d create a function and then use the wp_enqueue_scripts action to add your script to the list; function load_more_scripts() { wp_enqueue_script( ‘tsw-tools-js’, // unique handle name ‘/wp-content/plugins/dl-grid-addons/includes/wp-bakery/tsw/tsw-tools/assets/js/tsw-tools.js’ // path relative to WordPress root directory ); } add_action(‘wp_enqueue_scripts’, ‘load_more_scripts’); More information can be found here:

comment-reply.js is not loading

Maybe this helps you out? Please make a backup from functions.php and add following function. /** * Add .js script if “Enable threaded comments” is activated in Admin * Codex: {@link} */ function wpse218049_enqueue_comments_reply() { if( is_singular() && comments_open() && ( get_option( ‘thread_comments’ ) == 1) ) { // Load comment-reply.js (into footer) wp_enqueue_script( …

Read more

Why do WordPress adds the id=”handle-{js|css}” attribute to scripts and stylesheet?

The id attribute was added to the <style> tags in WordPress v4.1 (2014) — see the Trac changesets 29956 and 29958 which both mentioned ticket #30032 (“Add ID attribute to style element from wp_add_inline_style()“): In order to support partial preview refreshes (#27355), it is important for all partials being updated to have an element with …

Read more

How to enqueue js script after another specific js script?

That’s part of the default functionality available in wp_enqueue_script/wp_register_script. The third argument, as seen in the official documentation of enqueue/register script,,, is the dependencies array. $deps string[] Optional An array of registered script handles this script depends on. Default: array() So lets say you have script with the handle “sliderjs”, using your code …

Read more

Using wp_enqueue_script in a wordpress plugin

put these __initLivescore({“c1″:”F0F0F0″,”c2″:”BABCC3″,”c4″:”FFFFFF”,”c5″:”FFFFFF”,”c6″:”C90000″,”affiliate_id”:”0″,”menu”:”1″,”sportFK”:”1″,”odds”:”decimal”,”lang”:”3″,”timezone”:”AUTO”,”selected_tab”:”all”}); code in a js like demo.js file. and then use wp_enqueue_scripts and enqueue this file wp_enqueue_script( ‘script-name1’, ‘’); wp_enqueue_script( ‘script-name2’, plugin_dir_path( __FILE__ ) . ‘/demo.js’, array(), ‘1.0.0’, true );