Created
October 9, 2016 04:56
-
-
Save anilmeena/6201998aa35500966ecc503b4972ca20 to your computer and use it in GitHub Desktop.
Add CSS & JS files in WP functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Add CSS & JS files in WP functions */ | |
function wp_elevate_zoom_add_scripts() { | |
// Load jQuery if it isn't already | |
wp_enqueue_script('jquery'); | |
// Load custom jQuery | |
wp_register_script('wpez-min-jquery', get_bloginfo('template_url') . '/elevate-zoom/js/jquery-1.8.3.min.js', array( 'jquery' ), null, true ); | |
wp_enqueue_script( 'wpez-min-jquery' ); | |
wp_register_script('wpez-elevate-jquery', get_bloginfo('template_url') . '/elevate-zoom/js/jquery.elevatezoom.js', array( 'jquery' ), null, true); | |
wp_enqueue_script( 'wpez-elevate-jquery' ); | |
wp_register_style( 'wpez-main-style', get_bloginfo('template_url') . '/elevate-zoom/css/main.css', array(), '', 'all' ); | |
wp_enqueue_style('wpez-main-style'); | |
} | |
add_action( 'wp_enqueue_scripts', 'wp_elevate_zoom_add_scripts' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment