enqueue scripts problem
-
I add this code to use scripts js on my theme
but just masonry and admin bar js load on footer[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. Single quote does not work. ]
add_action( 'wp_enqueue_scripts', 'add_isotope'); function add_isotope() { //Register scripts wp_register_script('isotope', get_template_directory_uri() . '/js/isotope.pkgd.min.js', array('jquery'),true); wp_register_script('isotope-init', get_template_directory_uri() . '/js/isotope.js', array('jquery', 'isotope'),true); wp_register_script('imagesloaded', get_template_directory_uri() . '/js/imagesloaded.pkgd.min.js', array('jquery'),true); //Enqueue scripts wp_enqueue_script('masonry'); wp_enqueue_script('isotope'); wp_enqueue_script('isotope-init'); wp_enqueue_script('imagesloaded'); //Register styles wp_register_style('style-css', get_stylesheet_directory_uri() . '/style.css' ); //Enqueue styles wp_enqueue_style( 'style-css' ); }
- The topic ‘enqueue scripts problem’ is closed to new replies.