WordPress makes it very easy to access the underlying code of the themes and plugins that are governing how your site looks and functions. However, having a cavalier approach to editing these files can sometimes backfire, resulting in changes you can’t undo, or worse still, a broken, inaccessible website.
While we are all for customising your website and making changes to its code and stylesheets, it’s important to remember to take precautions to reduce the chances of something going wrong.
So with that in mind, we are going to look at some plugins which not only make it easier to make changes to your website’s CSS and PHP files, but also ensure those changes are long lasting, and stand a good chance of not permanently breaking your website.
What Sort of Changes Can You Make?
The main types of changes you can make to your website are related to its appearance and functionality. By editing the CSS files of your chosen WordPress theme you can make changes large and small, that can tweak tiny elements, or totally change the look of your website.
One of the great things about WordPress is the vast library of tutorials and code repositories online that include PHP that can be used to change how your website works and functions.
The plugins we will be looking at today aim to make it as easy as possible to add those code snippets to your website without running the risk of breaking your site in the process. They also make it easier to edit the CSS in use on your site and also add your own custom CSS to change its appearance.
If you want a safe and convenient way to edit how your site looks and functions, then there is a good selection of plugins that can help you out
Why Use a Plugin?
Using a plugin might seem like an unnecessary step when it comes to adding custom CSS and PHP to your WordPress website. If you are just adding a line of CSS to change a font or a background colour, why not just dive right in an edit the relevant files directly, and get the job done as quickly as possible?
So while WordPress does give you to tools to edit and theme files directly from your WordPress admin area, via the Appearance > Editor screen, it’s not always the best idea, especially on a live website.
You can even edit plugin files this way by using the editor located under the Plugins menu should the need arise.
However, using a plugin to manage your customisations to these files has a number of benefits and advantages.
One benefit of using a plugin is that it gives you a safer alternative to editing theme template files directly on your live site. When you open up that theme editor and start making changes to your live website, one wrong move and you could find that your website isn’t usable and you are left without a backup of the file taken from before you started working on it.
If you want to take the more sensible approach and edit your files locally and test your changes, you still have to get those files on to your computer, and then back onto the server. Not only can this take a bit of time and effort, but it might not be possible if you aren’t working on your usual computer, which has your FTP software and code editor of choice installed.
This is a situation that could arise if you ever need to quickly edit a theme file on the road, when you don’t have access to your regular workstation.
Another benefit of taking the approach offered by a plugin is that it allows you to keep the changes you make to the appearance and functionality of your site separate from the actual files.
This makes it easy to go back and quickly see any customizations you’ve made in the past, while also ensuring those changes aren’t overwritten each time the theme you are using is updated by its creators.
So now that you know how a plugin can help you out, let’s take a look at the different options available.
This free plugin is perfect for site owners that want to customise the appearance of the theme or any plugins that are active on their website. Instead of editing the core theme or plugin files, Simple Custom CSS give you an alternative way to make those tweaks and changes.
Once installed on your site this plugin adds a new menu item to the Appearance sub-menu entitled Custom CSS.
From here you can add custom CSS that will override the CSS in use on your site, whether that is from a plugin or theme. This plugin can be used to make customisation as small as changing the font size, through to large edits such as modifying the layout of your site.
If you want to make changes to the CSS in use on your site through an editor with a useful code syntax highlighter, without the need to tamper with any original files, then Simple Custom CSS is a great free option.
This free plugin will come in very handy for anyone who needs to add custom PHP to their theme template files. One benefit of using this plugin is that you can make changes to your site safe in the knowledge that they won’t be overwritten when installing an update that has been released by the developer of the theme.
Once the plugin is installed, it adds a new menu item to the Tools sub-menu on the admin dashboard. From there you can create a new override and then select which theme you want to edit, and then select the individual file.
The plugin then creates a new file based on the existing template file which you can then edit. This new file will override the original theme file, with your changes going live on the website when you hit the save button.
You then can view a list of all overrides on your site and edit and delete them as necessary.
This is a simple but effective plugin that lets you quickly and easily tweak your theme’s template files without the hassle.
When following WordPress tutorials online, you will often be required to add some code to your functions.php to achieve the desired result.
Messing around with your theme’s functions.php file can cause unexpected problems should you add the code snippet incorrectly, or delete existing code by mistake.
This plugin aims to eliminate those problems by giving you a way to add these functionality-enhancing code snippets to your site, without personally editing the functions.php file. It also makes it very easy to keep track of changes you or other users have made to that file. You can also import snippets from other locations.
There is also a free add-on available for this plugin called Code Snippets Tags which allows you to tag your snippets, making it easier to keep track of changes and additions on your site.
Also, from the same developer is the Functionality plugin. This free tool allows you to add code snippets and custom functionality to your site in the form of a custom plugin. This helps to keep those snippets separate and independent from the rest of your site, helping them to work no matter what theme you are using in the future.
The Genesis Extender plugin not only makes it very easy to add custom CSS and PHP to your website without editing any of the original files directly, but it also includes a CSS and PHP builder that will generate that code for you.
This is ideal for those with no or limited coding experience, but would still like to customise the appearance and functionality of their WordPress website.
Genesis Extender does a whole lot more than just the above, which helps justify its premium price tag. However, if you are looking for the most painless way to add custom code to your site, it’s a great option.
This premium plugin does only work with Genesis Framework child themes. However, if you are using that framework then it’s a powerful tool that gives you a lot of options when it customs to customising how your website looks and works.
Some might argue that these plugins aren’t entirely necessary due to the fact that you can edit the underlying files that power your website on the fly, through the WordPress admin panels.
However, if you want to minimise the risk of something going wrong when you are editing the most important files on your website, then these options come highly recommended.
How do you go about editing the theme and plugin files on your website and what precautions do you put in place to ensure nothing goes wrong? Share your tips in the comments below.
Disclosure of Material Connection: Some of the links in the post above are "affiliate links." This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers. I am disclosing this in accordance with the Federal Trade Commission's 16 CFR, Part 255: "Guides Concerning the Use of Endorsements and Testimonials in Advertising."