How can I get LESSPHP working with Wordpress? - wordpress

I'm trying to use the WP-LESS plugin along with the toolbox theme. I'm trying to migrate my static site over to wordpress, and I'd like to keep the HTML5 and LESS bits.
How can I get wordpress to compile style.less into style.css? Is there a right way to do it?

Have you read documentation for WP-LESS?
If not, this might help:
http://wordpress.org/extend/plugins/wp-less/faq/

Related

New to Drupal 7: Trying to figure out CSS

I inherited an already built Drupal 7 site. I have been able to figure out many things. But I am unclear on the CSS. A found a folder full of long-named CSS files but the code is all minified and hard to read. The previous developer had to be using some tools or services to alter and change the code in a more readable way. Does any know what the deal is ?
Also, I cant seem to find any way inside Drupal to enter CSS. I do not even see any classes or ID assigned to the blocks, views, nodes, or fields. So I have no clue how they were able to customize this site at all even though they obviously did. It uses Bootstrap 3 as a theme. Can anyone help explain how this works?
I will try to figure out the essence of the informations you given.
First: You have a Drupal 7 installation with compressed css files based on Bootstrap. That sounds the theme use less or sass precompiler for the theme css and you have the production (builded) instance of the project. Without the uncompressed less/sass/scss files it will be hard to edit the css. if you have no way to get the source files, the best way you can try is to add a extra css file and write you own css in it.
Second: Drupal strictly separates the code from the administration interface. Your PHP, HTML, CSS and other codes (except the WYSIWYG output) should not be entered via the administration interface. That's the best practice way. But anyway, there is a couple of modules that allows to write code inside the Drupal backend like this https://www.drupal.org/project/extra_css_js
Third: As information for you, Drupal 7s End of life is on November 28, 2022 so the best and recommanded way for you is: Freeze the Drupal 7s Instance as is (only Sercurity Updates and Hotfixes) and relaunch the Project with Drupal 9.
Drupal theme css files are mostly located in theme folder like "theme folder/css/style.css". As above mentioned, it might be used css minify tool or module for theme performance aspects. If it is created by drupal tools/module then once cache clear it will delete automatically and regenerate with new one with updated new css code on after page visit. You can also add custom css file by hook alter.

Will "Hello Elementor" automatically convert SCSS to CSS

I've just started using the WordPress page builder "Elementor" and have decided to move from "Genesis" to their own theme called "Hello Elementor". However, their theme uses SCSS and GruntJS.
On their documentation, they've included a custom.scss for all the custom styling. But when you add anything to this via WordPress, nothing happens. I know I could download the theme and use Visual Studio Code to make changes and use a sass compiler to automatically compile this for me, but it would require me to constantly upload files via FTP. Ideally, I would like to stay away from this.
Is there something I am missing? Or something I could do for WordPress to automatically compile this for me?
Edit:
If anyone has any recommendations of other themes to use with Elementor, I would really appreciate it.
They removed this option in Hello Elementor. You can no longer integrate custom scss. And I don't know since which version it's not present anymore, considering that I've tried the latest two ones and none of them seemed to accept the scss custom file.
However, you can check the answer they gave me a few days ago on the Hello Elementor GitHub page, if you want.
https://github.com/elementor/hello-theme/issues/85

What is the best way to implement a theme / template in meteor or angular-meteor

I've been having trouble implementing templates bought in themeforest in a meteor app.
I'm wondering, what would the best way to implement a template into a meteor app.
Two ways that I think of right now are:
(Tedious way)
Place javascript in Compatibility folder and try to name them in specific alphabetic order in order to get them to work properly.
Place css in client/lib folder and try to name them in specific alphabetic order in order to get them to work properly.
Place fonts and images in the public folder.
The second way (I haven't tested it yet) is to place the template files in the public folder and just link them manually (the old/non-meteor way) in the index.html file.
Now I'm not sure if these are the correct ways to do this and I would like some information regarding this issue.
Thanks!
I've done this myself with a themeforest theme.
Put the theme's css file under /client - it doesn't need to be in /public
Use the class names your theme uses in your templates. Typically a theme will have 3x what you really need so this ends up being much less work than it might seem. If your theme is built on bootstrap then it's even easier.
My theme used fontello a lot for icons, I had to recreate the folder hierarchy under client/fonts and then make sure the cross-references were correct.
Typically themeforest themes don't use js that much, I completely ignored all the js that came with my theme and created what I really needed in Meteor.

Material Design Lite: Is Installation on Wordpress possible?

Random and probably dumb question-can Material-Design-Lite blog template be fully installed on Wordpress? Downloaded the full template from http://www.getmdl.io/templates/blog/index.html and wondering how to use the entire file....
Thanks!
Sure it is possible! I actually was playing around with MDL and integrated it into WordPress. If you are interested you can grab it off GitHub:
https://github.com/braginteractive/MDLWP
Yes, you can absolutely make a Wordpress template using MDL. Helping you do that though... is a bit of a big task. Try looking for help around the web on just building Wordpress templates, then when are you working with HTML, use MDL classes and necessary attributes for components.
Yes. You'll probably want to do so by creating a new theme. The MDL templates provides static HTML, CSS, and Javascript. Wordpress requires PHP to dynamically add your content. You could approach this from two directions: modifying an existing theme or blank starter-theme to work with the CSS and Javascript, or adding the necessary php to the MDL HTML files (and making them php files).
You could also potentially add the MDL css and javascript through a child theme or plugin to use only select portions of it if you're not looking for a MDL Theme. At a minimum you'll need to add classes to the elements you want to affect, and watch out for potential conflicts.
Not sure of your level of experience, but here are some starting points.
Wordpress Codex on Theme Development
A tutorial on creating a theme from static html
A tutorial on including your css and javascript files
Write now there are two themes available for free
MDLWP - Free Theme and premium plugins available -
http://mdlwp.com/
Realistic - Free theme
https://wordpress.org/themes/realistic/

Using Twitter Bootstrap together with Wordpress

How do I use Wordpress together with Twitter Bootstrap? I know how to set up a Wordpress page and I've already worked with Bootstrap, but now I want to use these two together for the first time.
For my Wordpress projects I normally just installed Wordpress and started from scratch with creating a new theme. For my Bootstrap projects I always used Initializr to build a template.
Now using Google I found various "Bootstrap themes" and plugins , do I need one of those? I want to customize the bootstrap look with my own colors etc. using LESS, that's why I am asking. I am just having trouble to understand how these two will work together and I haven't found any good resource for it.
There will be a few ways to tackle this, but here's what I've been doing...
Take a copy of your favorite starting point theme
Download the full bootstrap repo (less and everything) and pop it into your theme folder.
Create a folder called 'css' inside the bootstrap folder and set this as your location to output your compiled 'bootstrap.css' file.
Then up in the theme root, open 'styles.css', change the theme name etc as you would if you were creating a new theme, delete all the styles and add just one line of code #import url("bootstrap/css/bootstrap.css");
You should now be able to select this new theme from your 'appearances' menu in 'wp-admin'.
It'll obviously look horrific, but once you add a few of your theme classes/IDs into 'layout.less'. Then run through 'variables.less' to add you base theme you'll be getting somewhere.
Other than that you'll have to go through each template file and consider all the classes/IDs, sometimes edit the theme to make better use of existing bootstrap classes, but other times you'll need to add you're own custom classes to bootstrap.
It's quite time consuming, but once its done it can obviously be re-used to speed up future projects.
Incidentally, I've also been building a theme using this same principle but based on http://stuffandnonsense.co.uk/projects/320andup/ both great projects. I'd recommend seeing which best suits you.
You could always us the Twitter Bootstrap WordPress plugin. It's completely free on WordPress.org here: http://wordpress.org/extend/plugins/wordpress-bootstrap-css/
There's also lots of shortcodes included so you can include Bootstrap elements within your pages and post - there's a demo page of it all here: http://worpit.com/wordpress-twitter-bootstrap-css-plugin-home/wordpress-shortcodes-demo/
Hope that helps you get started!
I answered the same question before here at stackoverflow. I feel like it's kind of late sharing but for those who are looking for such tutorial just click the hyperlinked title given: Using Twitter Bootstrap in Wordpress.
There is a quick way to do it, using composer in your theme:
composer.json
{
"config": {
"component-dir": "lib/composer",
"vendor-dir": "lib/composer",
"bin-dir" : "bin/composer",
"cache-dir" : "var/cache/composer"
},
"require": {
"twitter/bootstrap": "3"
}
}
Note: I removed the other composer's section and requirements and phing integration to reduce complexity.
Execute
composer install
And then in your theme, add /lib/composer/twitter/bootstrap/dist/css/bootstrap.css with this sentences
$bootUri = get_template_directory_uri() . '/lib/composer/twitter/bootstrap/dist/css/bootstrap.css';
wp_enqueue_style('sindy_bootstrap', $bootsUri);
et voilĂ ! :)

Resources