• Resolved The Servant

    (@avantprime)


    I am not sure how these WordPress hooks work, but would it be possible to specify sections of the website to process the css & js.

    • pages and posts as a group
    • specific pages
    • specific posts
    • categories, archives, etc
    • homepage
Viewing 1 replies (of 1 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    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.

Viewing 1 replies (of 1 total)
  • The topic ‘Only include CSS or JS on specific pages’ is closed to new replies.