So, I added a custom.css file in my wordpress root, now I'm wondering if it will be deleted on the next core update. Is it safe to just leave it there? Can I also create custom folders and files inside other wordpress folders like wp-content?
Taken from this link there are several other options for adding your own CSS, if you don't want to put it in the theme:
- Use Theme Options and paste in CSS
- Use a plugin to insert CSS/JS. You could also write your own plugin to 'host' the CSS file neatly in wp-content/plugins/ somewhere.
- Use a child theme, which will maintain your changes if your theme changes.
More info on each of these is in the link
Yes, those custom folders and files go inside the theme you're using. Wordpress groups files like HTML and CSS together in themes. What you should do is pop this CSS file in the directory of the theme you're using, and link to it there. Then it will definitely never get deleted, and then you have your own theme that you can apply to any Wordpress website.
So if your theme is called 'Nice Theme', you'll find a directory something like:
If there is a css directory in there, put your CSS in there, otherwise put it where it looks like it makes most sense, and update the point you refer to the CSS to include the extra part of the URL, e.g. if before the URL you used to load your CSS was:
Then now it should be: