How to Use Script and Styles in WordPress

Prem Tiwari - - WordPress Snippets


If you are a WordPress Theme OR Plugin developer and want to add your JS and CSS file to your site header area, then keep your close attention in this tutorial as I am going to share how to use script and styles in WordPress.

You can register your scripts and styles by using the wp_register_script() function. See the examples below:

How to Use Script and Styles in WordPress

Use the below code to add your JS file in WordPress site.

Use bellow function for add styles file on WordPress site.

If you want to add custom JavaScript code, use below code (But is bad)


About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


Tags: , , , , , , ,