Only include CSS or JS on specific pages

Hello,

with the plugin’s free version the CSS/JS custom codes will be loaded on all the pages. Nevertheless, you can specify the area where the CSS/JS codes are applied by the construction of the CSS/JS code.

For example, a CSS custom code that should change the <h1> elements only on the homepage will look like:

body.home h1 {color: red}

Or, a JS custom code that should work only on a specific page:

if ( $('page-id-123').length > 0 ) {
\\ execute my JS code here
}

But, if you want to load the CSS/JS custom codes only on specific pages, then you might want to look into the plugin’s pro version.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer