Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting

Wordpress hooks for Adding scripts with it


Wordpress has built in Javascripts and few other built in functions like plupload, tinymce, swf, simplepie, thivkbox  and  jQuery. There also you can add your custom scripts into it. here i will guide you to add your custom script into your WordPress theme. 


There are two possible sides to add your script. 
1. Admin end or Back end
2. Front end 

1. If you want add your custom script into wordpress admin page , you can add it in two areas. Header and footer sides.

Now if you want your script to run in header of your wordpress admin. just use this acction hook.

Before that save your custom script into a directory. than use this action script

add_action('admin_head', 'your script_function_name');

and also admin_footer for footer scripts. 

2. Front end scripts.

use this action on you theme functions.php or your plugin file

add_action('wp-head', 'your function_name_here');

also front end footer scripts

add_action('wp_footer' , 'your_function_name_here');

thats it to add your custom scrips into WordPress

0 Responses to “Wordpress hooks for Adding scripts with it”

Post a Comment

Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting