how to add jquery in wordpress plugin

how to add jquery in wordpress plugin

All web developers know about jquery. May be all of us know or heard about jquery. Jquery is javascript open source library. WordPress itself uses the jquery library for long time but many developers does not know about that.
Because When we develop new wordpress themes then we include the jquery files in that theme.

jquery tips for wordpress theme developers

jquery tips for wordpress theme developers
jquery tips for wordpress theme developers

In this tutorial I will give very simple and basic tips about using jquery in wordpress themes. Using jquery we will introduce very nice effect in our website. with jquery we can generate the more traffic to our website.

Jquery is very lightweight javascript framework. Many web developers developed developed the third party effects and code with jquery.
We can add the Jquery in wordpress theme with very minimal effect. wordpress is given the api for including the jquery in our wordpress theme.

Add Jquery in wordpress theme

For adding the jquery in wordpress you just need to use header.php or functions.php file and put following code in that file.
For header.php put following code in that file.

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php wp_enqueue_script(‘jquery’); ?>

If you want to use the functions.php file for adding the jquery then use following code.

function insert_jquery()
{
wp_enqueue_script(‘jquery’);
}
add_filter(‘wp_head’,'insert_jquery’);

Above are the very simple and basic tips for adding the jquery in your wordpress theme.

This code will include the latest jquery file in your wordpress theme.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.