Support » Plugin: GDPR Cookie Compliance (CCPA, PIPEDA ready) » turn off for mobile

  • Resolved webworks

    (@webworks)


    We are working on page score issues and need to maximize speed on mobile. How can we turn this plugin off for mobile, but keep the desktop?

    Thank you –

Viewing 1 replies (of 1 total)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @webworks,

    Thanks for using our plugins.

    You can try the following code snippet, should be added to your functions.php

    add_action( 'gdpr_disable_main_assets_enqueue', 'gdpr_cc_modules_on_mobile', 10, 1 );
    add_action( 'gdpr_disable_lity_enqueue', 'gdpr_cc_modules_on_mobile', 10, 1);
    add_action( 'gdpr_modal_base_module', 'gdpr_cc_modules_on_mobile', 10, 1 ); 
    add_action( 'gdpr_infobar_base_module', 'gdpr_cc_modules_on_mobile', 10, 1 );
    add_action( 'gdpr_branding_styles_module', 'gdpr_cc_modules_on_mobile', 10, 1 );
    add_action( 'gdpr_floating_button_module', 'gdpr_cc_modules_on_mobile', 10, 1 );
    
    function gdpr_cc_modules_on_mobile( $content ) {
    	return wp_is_mobile() ? false : $content;
    };

    Hope his helps.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.