• Resolved Markus

    (@markushenriksson)


    Is there any reason why the javascript and css-files are enqueued on every page? Not just the single product page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Emran Ahmed

    (@emranahmed)

    Yes, some user use shortcodes / pagebuilder to show single product. but you can use this filter hook:

    
    <?php
    
    function wvs_apply_only_product_page($default){
    	return function_exists('is_product') && !is_product();
    }
    
    add_filter('disable_wvs_enqueue_scripts', 'wvs_apply_only_product_page');
    

    Thank you

    Thread Starter Markus

    (@markushenriksson)

    That’s correct. I’m using shortcodes to add products on the frontpage and I’m trying to cut down on all the unnecessary scripts that is loading. Thank you so much. It works really well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Script and CSS are enqueued on every page’ is closed to new replies.