• Resolved whootboy

    (@whootboy)


    Hi,
    I just rewrote a static webpage into a wordpress theme to add several functionalities.

    I set up my styles as recommented. I added the wp_head()-Hook into my <head>.

    wp_register_style( 'myCss', get_bloginfo('template_directory').'/assets/css/style.less', array(), '0.7', 'screen, projection');
    wp_enqueue_style( 'myCss' );

    The commands are processed by WordPress, since the .less-file is in my head with now.
    <link rel='stylesheet' id='myCss-css' href='(xx)/assets/css/style.less?ver=0.7' type='text/css' media='screen, projection' />
    But it seems like it’s not recognized by your plugin. I have no idea why. Does my template require another specific hook besides wp_head() or something?!

    I tried it with and without wp_register_style – no difference.

    Any ideas on that?

    http://wordpress.org/extend/plugins/wp-less/

Viewing 1 replies (of 1 total)
  • The processing of LESS files happens during the ‘wp’ action hook. In your functions.php file, include the following:

    function theme_enqueue_less() {
    wp_enqueue_style('myCss', get_bloginfo('template_directory').'/assets/css/style.less', array(), '0.7', 'screen, projection');
    }
    add_action('wp','theme_enqueue_less');

    (apologies for the slew of edits, I had trouble formatting my code)

Viewing 1 replies (of 1 total)
  • The topic ‘my wp_enqueue_style is not recognized by wp-less’ is closed to new replies.