I've taken over the administration of a website. The developer before used GULP to track changes to the theme code. Unfortunately GULP is causing me more problems than it is helping me move forward, so I would like to know if there is a way to take GULP out of the theme again? The previous developer refuses to set up GULP for me. I only have access to the theme directly via WordPress or FTP. So now if I want to make adjustments to the CSS or the theme code, I have to do it on 3 files (that are named the same, but placed in 3 different folders), because the caching/mechanisms of GULP take effect in several places.
Since I'm not familiar with GULP I hope these information are enough for you to help me with that issue.
Related
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.
I just got thrown into a project involving WordPress with custom JavaScript, CSS and such, and I am using the Visual Composer plugin to edit the js and css, much to my dismay as there are no dev tools whatsoever.
I've got the site set up locally in PhpStorm, but I don't have a clue where the JS and CSS or whatever other editable code resides in files in WordPress. It's driving me crazy using the crappy UI with Visual Composer.
Can anyone tell me where to find these files? And, can anyone tell me where to put custom js files that need to be stored locally so that when they are called with:
<script src="meta-plugin.js"></script>
the file gets loaded.
Thanks for your help WordPress coders. I searched through the WordPress docs and couldn't find this info, so if it exists, if someone can just point me in the right direction, that'd be great.
I am a freelance developer, and I normally build sites from scratch without using any code generating sites like WordPress or Square Space. But my current client insists on using WordPress. However, I am rescuing this project from a previous developer who made a big mess because from the looks of it does not seem like they knew what they were doing.
Is there a way for me to restart everything, on a clean slate and template on WordPress? I would like to have none of what the previous developer has done. Also is there a way for me do do direct coding using HTML, CSS, JavaScript etc on a WordPress site?
Yes, you just need to look into how to create a theme, since themes are the basis of the Wordpress structure. Ultimately, if you have the code for a website, it can be broken into separate files that Wordpress can use.
See: http://www.wpexplorer.com/create-wordpress-theme-html-1/
If the previous developer has done all the work in the theme files, then simply switching the theme to a default theme (Like Twenty Sixteen) will give you a nice clean slate to dig in and jump off with. You will want to create a child theme of any existing theme if you want to make any changes. If, however, the developer has messed with other files besides the theme folder, then you will most likely want to export the content only (as a logged-in administrator, go to Tools > Export (here's a screenshot))
Then on a new environment (I prefer testing these things first on a local virtual environment like VVV, and then transition to a development subdomain on the same server that the site will eventually go live on and securing it with an htaccess user/password to block curious eyes), import the content on a fresh installation of wordpress via the same menu (Tools > Import). This will give you a fresh installation with the content that's been created, but without any of the mess.
For more information about importing content - here's the codex article.
I hope that's a good start - but if I've glossed over anything you don't understand, let me know - I'm happy to help.
I googled the same question but couldn't find the perfect answer, Can anybody make it clear on how to use LESS CSS in WordPress theme development? I don't want to rely upon online scripts.
I already tried https://github.com/sanchothefat/wp-less but no luck..
Your question is very broad? Too broad I think.
How does your develop process looks now? How do you want to compile your Less code.
Notice that Less code should be compiled into static CSS. Of course you can use the in browser version too, but in-browser compiling is not suitable for production.
Basically you should compile your Less into CSS first. You can compile styles.less into styles.css and upload that file into your wp-content/themes/yourthemes folder. Instead of styles.css you can use any other file and integrate in with the wp_enqueue_style function into your theme.
In the case that you want your Less code via the WordPress dashboard, you can install the WP Less to CSS plugin. This plugin compiles your Less code into a static CSS file as described above.
The JBST theme use the Less plugin describe above. You can also take a look at the Roots.io theme, which uses Less, npm and grunt to build.
A process that, for now, I use occasionally. I installed Koala, which creates CSS files from LESS on the fly. Then we create style.less and as we write code in it - through, for example, WinSCP upload to the server in the theme folder.
You can also use a copy of the site on a local server like OpenServer (OSpanel). With Koala create CSS automatically from LESS in theme folder on local server. After changes - upload them to the work server.
You can use Grunt.js to compile the file locally or some app lice CodeKit. Also you can use some wordpress plugins like this one: https://wordpress.org/plugins/wp-less/
I used that plugins before an it works fine.
I didn't know about the best practice of not skinning/modifying/working off of the core wordpress theme (twenty-ten, twenty-eleven, twenty-twelve, twenty-thirteen), and a bunch of my clients sites are running right now on the core themes with a custom/modified skin.
I've heard stories of wordpress getting hacked and sites being compromised because wordpress is out of date. The wordpress team also pretty much states that security issues are being fixed with each update. I need to update the core wordpress files on these sites to prevent this, but now I'm scared that if I update wordpress, the theme will be overwritten.
In fact, I had a client click the update button once in the wordpress admin (not really knowing what they were doing) and overwrite the theme (that was pretty disasterous). I even use a plugin now to disable that message so my other clients don't do that.
What steps should I take now to fix this? Copy the theme, rename the folder/theme name in style.css, and change the theme in admin settings? Would I be OK to update wordpress after I do this? Or are there more steps that I need to take?
You have the right idea. Copy the theme folder and rename the new copy to something else like customtheme. Then edit customtheme's theme info in the comments at the top of style.css and switch to it in the admin panel. After that you are safe to update.
Do keep in mind that it's possible WP updates will break things anyway, depending on how you implement custom functionality and what plugins you are using.
Agree with the above. Don't go anywher near the WP core or the default themes. Either create child themes or better off, build your own.
Copying and renaming and existing theme will cause you all sorts of problems as each theme uses named functions. If you just rename the stylesheet there will be more conflicts than you can fix in a week of debugging.
If you are blocking the update messages you are putting your clients at risk.