The general advice for users who want to make simple changes to a theme without losing those changes when updated is to create a child theme. This involves creating a directory, a CSS file, a functions.php file, and uploading them to the web server via WordPress or an FTP client.

Users should also ensure that the child theme correctly references the parent theme in order to establish the proper inheritance. This can be a complicated process for many people, but thanks to a new feature proposal for WordPress 4.7, going through this process will soon be a distant memory.

The advantages of adding a CSS editor to the Customizer

The proposal suggests adding a CSS editor to the Customizer which offers a number of advantages. Users can preview changes before they are applied and preview the result on mobile. Instead of directly editing files, changes are saved in a custom post format for each theme and override the style of the themes.

Related projects such as " custom changesets "(#30937) and revisions of customization settings (#31089) will lead to future improvements.

Here's an example of what the CSS editor will look like in action. Write down the line numbers which can be useful for troubleshooting purposes.

editor-css-customize-wordpress-4-7

The editor will also display error messages for common syntax errors. For example, for a missing brace. Adding the editor is just the start with revisions, syntax highlighting, and selectors help.

Special meeting scheduled to discuss storage issues

The developers of WordPress discussed the pros and cons of the editor and whether or not this feature should be added to WordPress 4.7. A point of contention preventing a final decision is how the data will be stored.

Members of the WordPress Core Development Team and Customizer components will discuss this issue in detail in a special meeting before making a final decision.

Essays and comments needed

To test this feature, you must apply the hotfix via " stage fright "Or the request for" Pullover On GitHub because you will not find that in the " WordPress Trunk ”Unless the proposal is approved. The team encourages you to add custom CSS in the customizer using a variety of themes and to share your experience and comments in the comments.

A use perfectly adapted to the Customizer

While I have yet to test this feature myself, it looks like this is a perfect use case for the Customizer. Some developers have expressed concerns with the proposed implementation, others are happy to see this feature built into WordPress.

Not having to create a child theme to make simple changes is a big win for users. It's also a big victory for those who provide support to non-developers. Instead of giving newbies complicated methods, it can be as simple as telling them to open the Customizer, click " CSS additionnal ", And paste the snippet, then click the" Save "button.

What alternatives in the meantime?

If you currently want to add CSS code to apply to your WordPress theme, you can still do this by using a plugin that injects CSS code into your WordPress blog.

header-and-footer-plugin-wordpress

I use in most cases the plugin " Header and Footer which is a solution that works with most WordPress themes. You will find this plugin on the directory of WordPress Plugin.

In one previous tutorial, I showed you how to make CSS changes organized on your blog, in order to be able to find you on each modification.

That's it for this tutorial. What do you think of the editor added to " Customizer "? Do not hesitate to share your opinion in the comments.