Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Load plugin styles/JS only for pages that needs them
- function my_deregister_styles() {
- if (!is_page('Contact')) {
- wp_deregister_style('contact-form-7');
- }
- if (!is_single()) {
- wp_deregister_style('tfg_style');
- }
- }
- function my_deregister_javascript() {
- if (!is_page('Contact')) {
- wp_deregister_script('contact-form-7');
- }
- if (!is_single()) {
- wp_deregister_script('tfg_script');
- }
- }
- add_action('wp_print_styles', 'my_deregister_styles', 100);
- add_action('wp_print_scripts', 'my_deregister_javascript', 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement