How to Add Specific CSS and JS to Specific Pages

| Last Updated: | In: WordPress Snippets


Hello friends, this is very quick and short tutorial about WordPress trick to adding specific stylesheet and JavaScript to specific pages in WordPress. Are you a WordPress Theme developer OR a WordPress Plugin developer, then keep your close attention in this post as I am going to share how to add specific CSS and JS to specific pages in WordPress.

How to add specific stylesheet and javascript to specific pages

Open the functions.php file from your current activated WordPress themes folder and copy paste below code at the end of the file and save it. Below code will add the stylesheet and javascript files only in the “your-template.php” page.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is 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.


You may also like:

Tags: , , , , , , ,