How to install jQuery Plugin into WordPress Theme
-
Hi, I’m trying to add this jQuery pluginto my WordPress Child theme of Responsive. The problem is after some heavy research, I got lost and have no idea how to add an external jQuery to a WordPress theme.
Here is how I’ve tried to do that without success:
1. Html identical as in the plugin’s exemple.
2. functions.php.
<?php function modify_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', false, '1.10.2'); wp_enqueue_script('jquery'); wp_register_script('modernizr_script', get_stylesheet_directory_uri() . '/js/modernizr.custom.js', array('jquery'), false, false); wp_enqueue_script('modernizr_script'); wp_register_script('grid_script', get_stylesheet_directory_uri() . '/js/grid.js', array('jquery'), false, false); wp_enqueue_script('grid_script'); } } ?>
3. sidebar-home-widgets-triple.php – at the end of the template file.
<script> var $ = jQuery.noConflict(); jQuery(document).ready(function() { Grid.init(); }); </script>
Many thanks!
- The topic ‘How to install jQuery Plugin into WordPress Theme’ is closed to new replies.