Add javascript to wordpress in header.php

WORDPRESS

Add this to functions.php

function my_custom_js() {
echo ‘‘;
}
// Add hook for admin
add_action(‘admin_head’, ‘my_custom_js’);
// Add hook for front-end
add_action(‘wp_head’, ‘my_custom_js’);

credits:http://stackoverflow.com/questions/5849057/adding-script-to-wordpress-in-head-element

Note: If you are unsure of the location, goto your ftp copy whole path i.e http://yoursite.com/wp-content/to/your/javascript.js file.


Like what you read?
Do you think you have knowledge to fetch Overseas Jobs and Projects?
Register here and start posting...
The following two tabs change content below.

Embedded Design Engineer by profession .Extremly intrested in Emedded Systems,Linux and Electronics.I truely believe in open source , join me in this mission by registering .

How to Integrate Google “No CAPTCHA reCAPTCHA” on Your Website


Leave a Reply