Pages

Wednesday, March 13, 2013

Wordpress add & remove script from head setion - resolved



add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );

function my_deregister_javascript() {
wp_deregister_script( 'plugin-shortcode' ); /*wp_deregister_script( 'ad-gallery' );*/
}

function my_scripts_method() {
wp_enqueue_script('custom-script',get_template_directory_uri() . '/js/yourscript.js',array('jquery') );
wp_register_style( 'custom-style', get_template_directory_uri() . '/css/yourcustom.css');
wp_enqueue_style( 'custom-style' );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');

No comments: