WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Contact Form 7] Javascript error with "Footer Javascript" is fixable (3 posts)

  1. yoursinwriting
    Member
    Posted 5 years ago #

    When I installed the "Footer Javascript" plugin, I noticed that I received javascript errors because the contact-form-7.js file was loading in the header, while the jquery.js file was loading in the footer.

    One fix is to change the contact-form-7.php file like this:

    1. On line 1153, comment out (or remove) the <script> tag that includes the javascript.
    2. On line 1162, inside the load_js function, change the wp_enqueue_script call to look like this:
      wp_enqueue_script('contact-form-7', WPCF7_PLUGIN_URL . '/contact-form-7.js', array('jquery', 'jquery-form'));
      which will add the javascript to the queue, and require that jquery and jquery-form are loaded as well.

    Hope this helps somebody, and it would be great if it could be incorporated into the next official release.

  2. Takayuki Miyoshi
    Member
    Posted 5 years ago #

    Thanks. I consider it for the next release.

  3. distantfuture
    Member
    Posted 5 years ago #

    Thanks so much for this solution, its one of the final corrections I needed for my site to go live : )

Topic Closed

This topic has been closed to new replies.

About this Topic