Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Always' and 'Deep' recompile options not working. #21

Closed
reitermarkus opened this issue Nov 22, 2012 · 8 comments
Closed

'Always' and 'Deep' recompile options not working. #21

reitermarkus opened this issue Nov 22, 2012 · 8 comments
Labels

Comments

@reitermarkus
Copy link

I don't know why, but for me, those two options are not working. Maybe you could give me a tip on how to find out why.

I have added WP Less to my theme functions.php:

$less = WPLessPlugin::getInstance();
$less->dispatch();
$less->install();
@thom4parisot
Copy link
Owner

Is WP-LESS installed as a plugin or bundled in your theme?

@reitermarkus
Copy link
Author

I have included it in a theme, but the strange thing is, I had the exact same theme running on a multisite install and the deep recompile worked.

@thom4parisot
Copy link
Owner

Hm, strange. Have you noticed errors? Is any file compiled in wp-content/wp-less/*?

If you bundle the plugin in your theme, prefer including bootstrap-for-theme.php. The install() thing is not going to work because it's tricky to detect whenever a theme is activated or deactivated (can't do both inside the same theme).

@thom4parisot
Copy link
Owner

Hi,

I've tried to reproduce the problem but it works properly.
Maybe do you have an active cache plugin on the blog where the problem happens?

@reitermarkus
Copy link
Author

I haven't noticed any errors, the compile is working correctly, but only if the main stylesheet is changed, not if imported files are changed.

I did include it using bootstrap-for-theme.php and the file is created in the uploads/wp-less/* folder.

@reitermarkus
Copy link
Author

I am using the following now, but it still isn't working:

function less_fallback(){
  if (!class_exists('WPLessPlugin')){
    require(dirname(__FILE__).'/lib/php/wp/less/bootstrap-for-theme.php');
    WPLessPlugin::getInstance()->dispatch();
  }
} add_action('plugins_loaded', 'less_fallback');

Edit: When using this it is absolutely not working. It doesn't even compile. Seems as if the plugins_loaded action does not work. When using init instead, it works.

@thom4parisot
Copy link
Owner

Hi,

there was a problem with WPLessPlugin::getInstance(), fixed in #27. Tell me if it changed something.
This has been released in 1.5.2 right now.

@reitermarkus
Copy link
Author

Thanks for informing me, unfortunately I can't check it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants