why jquery is not loading in wordpress page?
I want to add jquery plugin to wordpress webpage to provide some animations.
I have downloaded “jquery.plate.js” from jqueryscript.net and saved it locally in my custom themes,(js/jquery.plate.js) js folder.
<script src="//code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="jquery.plate.js"></script>
- I have added the above code in my header using “echo get_template_directory_uri();” function.
not working!
-
tried with adding following code in function.php:
function my_extrajs() { ?> <script src="//code.jquery.com/jquery-3.2.1.slim.min.js"></script> <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/jquery.plate.js"></script> <?php } add_action('wp_head', 'my_extrajs');
Still not working!
-
Tried with adding another code in functions.php:
function theme_name_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'jquery.plate.js', get_template_directory_uri() . '/js/jquery.plate.js', array('jquery'), '1.0.0', true );} add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
not working!!
$('.text-white.follow').plate();
this code is i used to retrieve jquery animation.for the following element:
<div class="col-md-1 col-2 social">
<span class="text-white follow"><label>FOLLOW</label></span>
<span><a href=""><img src="<?php echo get_template_directory_uri(); ?>/images/social1.png"></a></span>
<span><a href=""><img src="<?php echo get_template_directory_uri(); ?>/images/social2.png"></a></span>
<span><a href=""><img src="<?php echo get_template_directory_uri(); ?>/images/social3.png"></a></span>
</div>
Any idea, where i missed??
Also,i am beginner in wordpress.Any help would be appreciable.
Leave an answer