I have plugin I would like to use only on the contact page, however the script and css is being loaded on every page. Aside from the increased http requests, it is also causing another script to not work properly on another page.
Is there a way to stop this plugin from loading anywhere else on the site?
I know how to do this with normal scripts in the header, but I am not sure how to do this with a plugin that automatically injects scripts into the header.
I have plugin I would like to use only on the contact page, however the script and css is being loaded on every page. Aside from the increased http requests, it is also causing another script to not work properly on another page.
Is there a way to stop this plugin from loading anywhere else on the site?
I know how to do this with normal scripts in the header, but I am not sure how to do this with a plugin that automatically injects scripts into the header.
Thanks in advance.
Is the site WordPress because if it is there is a good plugin to to it called "Art Direction". I hope this is helpful to you.
You can simply do this with a PHP if-statement. I wouldn't use a plugin for this.
If is contact page > echo this script
@Htmlmainiac thanks but I don't think that's the purpose of that plugin. Yeh @chrisburton I decided to go with this solution...
http://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/
You edit the wp.config file with the scripts you wish to not load...
...and then manually enqueue them on the pages you wish to load the script.
Nice.