• I am using Wishlist only in product and Wishlist page. So, I want to load all the css and js files to load only these pages instead of loading in all pages.

    Can you help me?

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi there

    Please, try to add the following snippet of code at the end of functions.php file of your theme or child

    if ( ! function_exists( 'yith_wcwl_selectively_dequeue_assets' ) ) {
    	function yith_wcwl_selectively_dequeue_assets(){
    		if ( is_product() || yith_wcwl_is_wishlist_page() ) {
    			return;
    		}
    
    		// dequeue assets
    		wp_dequeue_style( 'jquery-selectBox' );
    		wp_dequeue_style( 'yith-wcwl-font-awesome' );
    		wp_dequeue_style( 'yith-wcwl-main' );
    		wp_dequeue_style( 'yith-wcwl-theme' );
    
    		// dequeue scripts
    		wp_dequeue_script( 'jquery-selectBox' );
    		wp_dequeue_script( 'jquery-yith-wcwl' );
    	}
    	add_action( 'wp_enqueue_scripts', 'yith_wcwl_selectively_dequeue_assets', 15 );
    }
    

    This will remove all wishist’s assets from any page, excepting for wishlist and single product

Viewing 1 replies (of 1 total)
  • The topic ‘Load all yith files only in product and Wishlist page.’ is closed to new replies.