• Resolved Samot80

    (@samot80)


    Will it be possible to load the plugin only the page where the plugin is used, instead of the whole website?

    That can be done with Contactform7

    `function deregister_cf7_js() {
    if ( !is_page(array( ‘contacto’ ) )) {
    wp_deregister_script( ‘contact-form-7’);
    }
    }
    add_action( ‘wp_print_scripts’, ‘deregister_cf7_js’ );

    function deregister_ct7_styles() {
    if ( !is_page(array( ‘contacto’ ) )) {
    wp_deregister_style( ‘contact-form-7’);
    }
    }
    add_action( ‘wp_print_styles’, ‘deregister_ct7_styles’);

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Hello @samot80 ,

    Yes you can remove the script from my plugin.

    You may try this for js

    if ( !is_page(array( 'contacto' ) )) {
    wp_deregister_script( 'contact-form-7');
    wp_dequeue_script( 'codedropz-uploader' );
    }

    and for css.

    if ( !is_page(array( 'contacto' ) )) {
    wp_deregister_style( 'contact-form-7');
    wp_dequeue_style('dnd-upload-cf7');
    }
    Thread Starter Samot80

    (@samot80)

    Thank you very much for your help, Greetings

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Avoid loading the entire website’ is closed to new replies.