WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] PHP Notice: Undefined index: contact-form-7 (6 posts)

  1. rl421403
    Member
    Posted 1 year ago #

    I am having this issue in almost all my wordpress website.

    [14-Oct-2012 14:44:31] PHP Notice: Undefined index: contact-form-7 in /home/domain.com/wp-includes/class.wp-scripts.php on line 163

    http://wordpress.org/extend/plugins/contact-form-7/

  2. rl421403
    Member
    Posted 1 year ago #

    Sort of fixed my problem. :)

  3. slurve
    Member
    Posted 1 year ago #

    How did you fix? I noticed this error on my site when I deregistered CF7's scripts and styles conditionally in functions.php.

  4. edDraw
    Member
    Posted 1 year ago #

    If you want to deregister CF7's scripts and styles, you should consider this method :

    In your wp-config.php:

    define('WPCF7_LOAD_JS', false);
    define('WPCF7_LOAD_CSS', false);

    And if you want to register them again for a specific page, then in your function.php write something like that:

    if ( is_single('contact') ) {
      wp_register_style( 'contact-form-7', 100 );
      wp_register_script( 'contact-form-7', 100 );
    }

    Or see complete explanations here : http://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/

    Hope it will help!

  5. rl421403
    Member
    Posted 1 year ago #

    Yes, that's what I did. use edDraw's method.

  6. edDraw
    Member
    Posted 1 year ago #

    If someone try this again, the method has slightly changed :

    http://contactform7.com/loading-javascript-and-stylesheet-only-when-it-is-necessary/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic