How to edit CSS in WordPress
How to add your own styles in WordPress or edit existing ones? Very simple! There are several ways to do this.
The first way (wrong way!)
The most common way people edit styles in the template is when they simply go to the admin dashboard in section Appearance -> Theme Editor and there they find the file style.css, where they paste their css code.
Click the “Update File” button, and now you’ve added your CSS code to WordPress. But why you shouldn’t do that? Because the next time you update your theme (and you need to update templates!) all the changes you’ve made will be gone.
What should you do? You can create a child theme and edit the CSS file styles there. How to do this we have described in this article.
Also, you should not edit the style.css file of the parent theme via your hosting file manager or FTP. The reason is still the same – your code will be deleted after the template is updated.
The second way
This way is more correct. WordPress allows you to edit CSS in a special built-in editor. How it works?
- Select the “Appearance -> Customize” tab in the admin panel;
- Then in the left menu find the tab “Additional CSS” (usually at the very bottom);
- Insert the css code you want and don’t forget to click on the “Publish” button at the top.
IMPORTANT: These styles will be saved only for your current theme. That means, if you decide to change the template, your CSS code will stop working.
But, again, in our opinion, the most correct way to edit the CSS code in WordPress is to create a child theme and add/change styles already in it.