Viewing 5 replies - 1 through 5 (of 5 total)
  • add this before wp-less plugin initialises

    add_action('wp-less_compiler_construct_pre', function($compiler) {
    	$compiler->setFormatter('compressed');
    });

    https://github.com/Pravdomil/wp-pravdomil/blob/master/less.php

    babouz44

    (@babouz44)

    Hello,
    can you explain me in which file we have to put this function ?

    pravdomil

    (@pravdomil)

    You can put it in the theme functions.php file.

    babouz44

    (@babouz44)

    Ok i found 🙂
    It’s in the theme function.php :

    function nt_less() {
        add_action('wp-less_compiler_construct_pre', function($compiler) {
            $compiler->setFormatter('compressed');
        });
         if ( ! is_admin() ) {
            wp_enqueue_style( 'less-style', get_stylesheet_directory_uri() . '/style/styles.less' );
            wp_enqueue_style( 'fontawesome-style', get_stylesheet_directory_uri() . '/style/font-awesome.less' );
         }
    }

    babouz44

    (@babouz44)

    sorry pravdomil…
    I had not refreshed the page and I had not saw your answer 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Minify output’ is closed to new replies.