Support » Plugins and Hacks » Limit plugin includes (css/javascript) to single page?

Limit plugin includes (css/javascript) to single page?

  • Is there a way to limit plugin includes (js/css) to a single page?

    Most of my plugins are used on a single page (ie. Contact Form), yet these plugins are including it’s javascript and css throughout my entire site. Not only is this causing excess load times, in some cases it causes conflict with other plugin scripts.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have this problem too…. anyway around having the JS and CSS for a particular plugin only load on the page it’s being used?

    I too would like this answer, it would be nice if the page editor had a list of all plugins that you could check or uncheck by page to use or not.

    Actually that’s rather simple.

    1. Create a “header-2.php” or something like that including your extra css and js.
    2. Next, create a page template that includes the alternate header file INSTEAD of the regular “header.php”.
    3. Finally, use that page template to do your contact form stuff and co.

    Done – mission accomplished!

    An alternative would be use 2 header files. The original “header.php” that is included in every theme file… and in a page template, an additional include of an “additional-header-file.php” (name it yourself) that contains only the JS and CSS you need/want to add to your header.

    (Just Saying)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Limit plugin includes (css/javascript) to single page?’ is closed to new replies.