Use LESS file in WordPress that compiles on the fly - css

I am developing a WordPress Plugin. Which have the dynamic colors options from WordPress Backend.
Now, in a plugin, I am using the LESS file with variables to give the dynamic output to the users whenever they change the colors from Backend Admin Settings.
If anyone can help me with the tool that compiles the LESS file on the fly and make the CSS file.
OR
Can I use the LESS file directly in my WordPress enqueue_script?
Please suggest the best.

Related

Where to put the files when setting up endpoints for wordpress REST API

I'm trying to set up some custom endpoints using the WordPress REST API. But I can't figure out where to put the files so it does not disappear when for example, updating plugins, themes or WordPress itself.
So I guess I can't place them in the Theme im currently using, or in the plugins/rest-api folder.
Anyone knows where to put the files?
Consider setting up a child theme: https://codex.wordpress.org/Child_Themes
Or, write a simple plugin: https://codex.wordpress.org/Writing_a_Plugin

Turning my current website configuration into a wordpress theme

My searches for this keep turning up "How to make a wp theme from scratch" which is not what I want. I made a website using the theme Scrawl, but I made a bunch of modifications. I would like to turn this into a theme so I can use it to make other sites without having to do much of the work again. Is it possible?
The theme is simply the skin of the website. The configuration of the site, in broad sense of the word, is stored in the database and config files. If you want to transfer that, you can export the configuration settings from one site and import it in the other.
If you've only made modifications within the theme folder, you can simply .zip that folder and import the theme somewhere else.

Transfer the code of a custom plugin into a theme

I am working on a new project on WordPress.
I am developing a new website for a client based on their actual site (developed by an other team).
So, I decided to create a new WordPress theme and to use the existing content (client's request).
However, this supposes to reuse the custom plugins, in order to not re upload the pictures and the articles by hand.
I would like to include the custom plugins into the new theme. However, the plugins folder is outside the theme folder. So I was wondering if you have an idea on how I could transfer the code of a custom plugin into the new theme.
Thank you in advance.
What custom plugins are being used to handle pictures and articles? Uploaded files should go to /wp-content/uploads and all data is stored in the database. Removing the plugins might make the data inaccessible, but it shouldn't disappear.
Why are you moving functions from plugins to a theme? Or are these plugins inside of the /wp-content/themes/ folder? The way you handle the two cases is very different.
If you need to copy certain functions into a theme, you can move them into a functions.php file (or a functions.php file that calls to other files in that directory) in a child theme. The WordPress Codex has much better documentation on child themes than I could ever outline here. Placing the functions into your main theme is a permanent change and is not recommended when you're dealing with functions that are better-suited to plugins.
If you're copying plugins from one theme into another, you might want to look at plugin dependencies using TGM Plugin Activation.

Joomla css file rewrites it self

I was wondering why .css file rewrite itself on Joomla.
I have bought Joomla template. In template manger under general settings I am using Development Mode On. If I use Development Mode OFF I am not able to change .css files.
For example: I am using theme which is located in t3-assets/dev/ theme i choose
When I use On mode I find section I want to change, it works. But after some time it rewrites it self. I was wondering how to prevent that if possible?
Some templates are overwritten alone , go to your server and take off the writing mode in the template folder.
My guess is that the template is using LESS, so CSS are compiled each time you modify LESS. If that is the case, you should not prevent it, but find the correct way to include your modifications (probably there's a "custom.less" or similar file for that).

is it possible for wordpress theme to work without wordpress?

I have bought this Wordpress theme:
http://themeforest.net/item/wp-pro-real-estate-3-responsive-wordpress-theme/1763306?ref=contempoinc
but I was stupid enough to forget that Wordpress will need to be installed in order to customize and work on it. Is it possible to run it on some server without Wordpress being include, to consider it as "done" template?
No, not in any practical way. Themes operate inside WordPress the way FireFox addons work inside Firefox or the way an Android App needs Android (to a lesser extent).
You must have WordPress to use a WordPress theme. There are too many class and function dependencies to run the theme without WordPress. It would be near impossible to even a load a theme and get all the templates to work without the WordPress core managing things.
You are better off starting from scratch than you are trying to edit the "WordPress" out of a WordPress theme.

Resources