Tag Archives: enque

Enqueue script for admin


function photoshoot_admin_scripts() {
wp_enqueue_style('medics-bootstrap',get_template_directory_uri().'/css/bootstrap.min.css',array(),'','');
}
add_action( 'admin_enqueue_scripts', 'photoshoot_admin_scripts');

Advertisements

Enque online jquery.min.js

wp_enqueue_script(‘jquery-ui’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js’, array(‘jquery’), ‘1.11.1’);

Enque script in theme (frontend)

function generator_enqueue()
{
wp_enqueue_style(‘bootstrap’,get_template_directory_uri().’/css/bootstrap.css’,array(),”,”);
wp_enqueue_style(‘style’,get_stylesheet_uri(),array(),”,”);

wp_enqueue_script(‘bootstrapjs’,get_template_directory_uri().’/js/bootstrap.js’,array(‘jquery’));
}
add_action(‘wp_enqueue_scripts’, ‘generator_enqueue’);

Enque script for plugin (backend)

function load_admin_style()
{
wp_enqueue_style( ‘admin_css’, ATTENDANCE_URL . ‘css/mycustomestyle.css’, false );
wp_enqueue_style( ‘datepicker1’, ATTENDANCE_URL . ‘datepicker/jquery-ui.css’, array());
wp_enqueue_script( ‘datepicker2’, ATTENDANCE_URL . ‘datepicker/jquery-1.10.2.js’, array());
wp_enqueue_script( ‘datepicker3’, ATTENDANCE_URL . ‘datepicker/jquery-ui.js’, array());
wp_enqueue_script( ‘mycustomscript’, ATTENDANCE_URL . ‘js/mycustomescript.js’, array());
}
add_action( ‘admin_enqueue_scripts’, ‘load_admin_style’ );

%d bloggers like this: