Jump to content

Archived

This topic is now archived and is closed to further replies.

Buishi

Create 'Developer Mode' that auto-compiles the styles.less file on refresh

Recommended Posts

Buishi

I'm really tired of going to site settings>resets>flush cache everytime I want to see a small CSS change. It would be amazing if there was a checkbox in the site settings that would allow recompiling of the less file with every refresh, even more amazing would be if this was exclusive to logged in admins, so it wouldn't slow down the site for anyone else.

Share this post


Link to post
Share on other sites
Simon

Developer plugin has this option already.

Share this post


Link to post
Share on other sites
Buishi

I ended up adding an option to the child theme (recompile_less) and adding the following to functions.php:

if(pl_setting('recompile_less')){
    add_action('init', 'DRWchild_recompile');
    function DRWchild_recompile(){
        global $dms_cache;
        $dms_cache->purge_all();
    }
}

Note that adding this to wp-config doesn't seem to work:

define('PL_LESS_DEV',true);

Share this post


Link to post
Share on other sites

  • Similar Content

    • chamois_blanc
      By chamois_blanc+
      I haven't seen any PL5 active development in months. Starting to look at alternatives like Elementor. It looks like PL5 development is dead. Am I wrong?
    • GreyFoxWebDesign
      By GreyFoxWebDesign+
      Hi, could you let me know where the custom less/css is saved to - i.e. how I could access it directly via the server.
      I hid the Admin Bar by mistake and now can't save any changes to the Custom CSS as the Save Button is not available - so I need to find another way to access and edit the custom CSS.
      Thanks in advance
    • Audun MB
      By Audun MB+
      How do I get the LESS in a child theme to compile?
    • dymond
      By dymond+
      I've been trying to upload a video to use as a video background, but the size was 12m, and the alotted max file size is 8m. I downloaded a couple of pugins that increase the size by creating php.ini files and all of that jazz, but to no avail. It would say (Max file size = 250mb) but after I uploaded I would get an "HTTP ERROR",
      Soooo I logged into my cpanel and saw that the php I was using was 4 version out of date. I upgraded my php to PHP 5.6 and now I get
      Fatal error: Out of memory (allocated 39583744) (tried to allocate 15 bytes) in /homepages/39/d200014696/htdocs/dymondentertainment.com/wp-content/themes/dms/dms/includes/less.plugin.php on line 848
      When I activiate another theme that is not pagleines, the site works fine.... but will no longer work with Pagelines DMS Version 2.2
       
      My site has no gone dark. What can I do?
    • station16
      By station16
      I installed DMS for a new site and got an error message on install and when I install any plugin.
      Warning: Invalid argument supplied for foreach() in /nfs/c09/h04/mnt/208781/domains/prevailcoffee.co/html/wp-content/themes/dms/dms/includes/less.legacy.php on line 818
      I installed the latest DMS 2.1.9.6
       
      Please advise. I'm now having issues getting any plugins to work. Not sure what to do next.
      thanks,
      -b
×