only load js when necessary
-
Hi,
I am using supersocializer on only two pages (login and register) but it is loading everywhere, consuming resources and making the site slower than needed.
Trying to solve it I set :
<?php if ( is_single() ) { wp_dequeue_script('the_champ_ss_general_scripts'); wp_dequeue_style('the-champ-frontend-css'); } ?>
in my header.php (just before wp_head) and
– I unticked “load js in footer”
– I unticked “activate social sharing”
– I ticked “not load modernizer” in the social sharingfollowing older topic on this forum, my intuition in the plugin options and what’s working for another plugin (contact-form7 is well documented). But it doesnt seem to work with supersocializer.
I still have
super-socializer/js/front/social_login/general.js (975B)
super-socializer/js/front/social_login/google.js (835B)
super-socializer/js/front/facebook/sdk.js (748B)
super-socializer/js/front/social_login/facebook.js (416B)
super-socializer/js/front/social_login/linkedin.js (310B)
super-socializer/js/front/social_login/common.js (3.5KiB)
Loading for no reason
(example: https://bit.ly/1LzGZhG)I am probably doing something wrong, but I would happy if somebody could tell me what and would help me solving the issue.
Many thanks in advance for your help
SincerelyTche
- The topic ‘only load js when necessary’ is closed to new replies.