Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

wordpress enqueue jquery

add_action('wp_enqueue_scripts', 'my_register_script_method');

function my_register_script_method () {
    wp_register_script( 'jqueryexample', 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js');
}
Comment

wordpress enqueue js

add_action( 'wp_enqueue_scripts', 'my_plugin_assets' );
function my_plugin_assets() {
    wp_enqueue_style( 'custom-gallery', plugins_url( '/css/gallery.css' , __FILE__ ) );
    wp_enqueue_script( 'custom-gallery', plugins_url( '/js/gallery.js' , __FILE__ ) );
}
Comment

enqueuing javascript in wordpress

function mysofthunt_enqueue() {
    wp_enqueue_script(
        'softhunt-script',
        plugins_url( 'softhunt.js', __FILE__ )
    );
}
add_action( 'enqueue_block_editor_assets', 'mysofthunt_enqueue' );
Comment

PREVIOUS NEXT
Code Example
Javascript :: initialize set with array javascript 
Javascript :: prisma decimal 
Javascript :: solcjs 
Javascript :: json parse js 
Javascript :: javascript pipe function 
Javascript :: javascript add to string 
Javascript :: logical operators in javascript 
Javascript :: js array map skip element 
Javascript :: mapbox add a leaflet marker with popup 
Javascript :: sort array in ascending order javascript 
Javascript :: multiple replace 
Javascript :: production server next.js 
Javascript :: Iterate with JavaScript Do...While Loops 
Javascript :: how to name a javascript variable 
Javascript :: Generate a random Id safely 
Javascript :: setattribute 
Javascript :: change height of div with scroll in javascript 
Javascript :: react native geocoding 
Javascript :: set state 
Javascript :: percentage with react 
Javascript :: js clone obj 
Javascript :: js create nested object from fields 
Javascript :: defined variables if null javascript 
Javascript :: javascript console log 
Javascript :: split js 
Javascript :: react native date time picker modal 
Javascript :: error handling in node.js 
Javascript :: object destructuring es6 
Javascript :: javascript set() method 
Javascript :: every element in list after first javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =