Advertise on Site! You can Advertise on our site. Find out More

jquery tips for wordpress theme developers

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.

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.

<?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.

11 Comments

Add a Comment

Your email address will not be published. Required fields are marked *