Give help. Get help.

  • # December 24, 2012 at 7:39 am

    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.

    # December 24, 2012 at 9:10 am

    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

    # December 24, 2012 at 9:19 am

    @Htmlmainiac thanks but I don’t think that’s the purpose of that plugin. Yeh @chrisburton I decided to go with this solution…

    You edit the wp.config file with the scripts you wish to not load…

    define(‘WPCF7_LOAD_JS’, false);

    …and then manually enqueue them on the pages you wish to load the script.

    # December 24, 2012 at 9:23 am


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.