The plugin cforms run correctly but It's possible load the file css only in the page where I put a contact forms to reduce bandwitch on the server web?
There is no elegant way of solving your requirement, since the header is being written far earlier than the content is being searched for possible forms. There is simply no way for the plugin to know beforehand…
However, you can certainly hard code an if(…) into cforms.php just before the stylesheets get added and check for your specific page, e.g. via $_SERVER[REQUEST_URI]
What about if we have a seperate template page designed just for the the contact page? I know how to do this, but I'm having a bit of a hard time finding what part of the plugin adds the stylesheets and javascript to *all* the pages (into header.php I presume). If I can just find that, then I can add it manually to my conact page to prevent it from being loaded on all the other pages that don't use cforms. Thanks!
That won't help because even if you use a different page template, the header is still the same.
The easiest way would be to install a plugin (forgot what the name was) that allows you to run certain plugins only on certain pages of you blog, very easy to configure.
Good point, but I could just copy and paste the contents of the header file into the template. I know I would have to change the page every time I changed the header, but that would be practically never and I could live with that. I found the functions I need (cforms_style(); and cforms_insert();) but I haven't tried them on a template page yet. Thanks for the help, and great plugin. Very extensive.
I'm really interested in this plugin that you speak of….can you remember what it's called because i can't find it by searching through the wordpress plugins? is it WP-Cache?
my site would perform so much better with this plugin!
Well after trying out the plugin, it's actually harder than it sounded. You have to uninstall the plugin and then go to the pages that you want to use the plugin and choose to run the plugin…..sounds straight forward but it didn't work at all when i tried doing it.
I've read in another forum that i should try putting a conditional statement in the cforms code like:
if ( is_page('contact') ) {
// load css and js
}
would this work? and what exactly should the code be?
If you do it manually, like you described it, yes it will work.
Unfortuntely this can't be done by the plugin, since it can't know on which pages it will eventually be shown.
But I could think of a an configuration field in cforms that would allow you to enter all page IDs for which to load the cforms header…perhaps in the next release…