How to Add Specific CSS and JS to Specific Pages

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.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.


Article Tags: , , , , , , ,

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.