• Hello Team Heateor,

    I run my website in tools pingdom website and i find out that sassy social share CSS and JS is running on the home page of my website even i did not enable the sharing icons on the home page.

    I don’t want this running on the home page of the website because it affects the website speed.

    Can you help me resolve this?

    Thanks

    Regards,
    Aaron

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Heateor Support

    (@heateor)

    Hi Aaron,

    To remove the CSS and JS from homepage, you can place following code at the end of functions.php file (before ?> tag at the end, if there is any) of you current child theme (if you have one) OR main theme:

    function heateor_sss_dequeue_scripts_and_styles() {
    	if ( is_front_page() ) {
    		wp_dequeue_script( 'heateor_sss_sharing_js' );
    		wp_dequeue_style( 'heateor_sss_frontend_css' );
    		wp_dequeue_style( 'heateor_sss_sharing_svg' );
    		wp_dequeue_style( 'heateor_sss_sharing_svg_hover' );
    		wp_dequeue_style( 'heateor_sss_vertical_sharing_svg' );
    		wp_dequeue_style( 'heateor_sss_vertical_sharing_svg_hover' );
    		wp_dequeue_style( 'heateor_sss_sharing_default_svg' );
    	}
    }
    
    function heateor_sss_dequeue_javascript() {
    		add_action( 'wp_enqueue_scripts', 'heateor_sss_dequeue_scripts_and_styles' );
    }
    
    add_action( 'init', 'heateor_sss_dequeue_javascript' );
    Thread Starter Cowboy Coding

    (@devaceza-1)

    Hi,

    Good Day.

    I follow the instructions you given and it WORKS!, thank you. ??

    I hope this functionality will be included in your next update. You know what I mean? When I don’t set the page to display the social share icons on that particular page, the JS and CSS of SSS should not be running on it.

    Thank you so much once again, you guys are awesome.

    Plugin Author Heateor Support

    (@heateor)

    Sure, we will include it in the plugin ASAP.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent CSS and JS running on home page.’ is closed to new replies.