Home Forums Newsletter Plugin Support Remove validate.js from footer

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28020
    Andrea66
    Participant

    Hi

    for pagespeed reasons i want remove validate.js from footer in single article
    where there is not newsletter form.

    I’have try putting tuyhis in function.php of theme

    if(is_single()){
    unset($this->style_footer_queue[‘validate’]);
    }

    but it doesn work.

    I can do?

    Thanks

    #28034
    Stefano
    Keymaster

    The script is registered with standard script enqueue functions, you should deregister it.

    Stefano.

    #28376
    Andrea66
    Participant

    Hi Stefano

    I’ve try with

    // Remove validate.js from footer
    function clean_validate(){
    wp_deregister_script( ‘validate’ );
    }
    add_action(‘init’,’clean_validate’);

    but not does not work.

    Do you have a suggest?

    I will summarize: problem is that i have in code (and i want remove on single article)

    <script type=’text/javascript’>/* */
    var newsletter = {“messages”:{“email_error”:”L’email non \u00e8 corretta”,”name_error”:”Il nome non \u00e8 corretto”,”surname_error”:”Il cognome non \u00e8 corretto”,”profile_error”:””,”privacy_error”:”Devi accettare le regole sulla privacy”},”profile_max”:”20″};
    /* */</script> <script type=’text/javascript’ src=’http://www.site.com/wp-content/plugins/newsletter/subscription/validate.js’></script&gt;

    Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.