- This topic has 5 replies, 2 voices, and was last updated 2 years, 5 months ago by
Fernando.
-
AuthorPosts
-
October 25, 2022 at 2:58 pm #2386363
Ian
I think I remember reading a comment that the customizer additional css loads after the child css. Over the years, whatever css I have tested in the customizer gets pasted into the child css. Should the site ever need to swap themes for testing, I did not want any chance of losing custom css from the customizer. This fear was from while ago. Is this still the case the the customizer might lose css when swapping themes. I also remember swapping themes could lose assets like site logo etc… Is this still the case?
I guess the bigger picture question is. If using the snippet plugin + customizer css, is it still a best practice to run a child theme in GP?
October 25, 2022 at 5:24 pm #2386460Fernando Customer Support
Hi Ian,
It’s normal that if you switch to any theme, the customizer CSS and other settings won’t carry over to that theme. In WordPress, theme settings, and correspondingly, CSS codes are inherent only to your current theme. If you’re switching to the GeneratePress child theme from the GP theme, the logo and other customizer settings except for Additional CSS should carry over.
Now with regards to using a Child Theme, I find two cases where the need to use a Child theme would be more or less necessary or optimal:
1. If you plan to add/edit theme template files.
2. If your CSS in the customizer exceed 500 – 600 lines. It would be more optimal performance-wise to use a Child theme and place the CSS in thestyle.css
fileOctober 25, 2022 at 5:40 pm #2386482Ian
Thanks Fernando. That is very good insight.
I don’t usually edit theem template files and most custom css also do not exceed 500 lines normally. Having said that, if I need to switch to a default WP theme to test something and then switch back to GP, can I ask if customizer CSS will stay intact? ie. Are the custom css in customizer stored in the dB so as long as I do not uninstall GP, the custom css should return from swapping out a theme temporarily?
It’s very convenient to build in the customizer css. Wondering if I can safely move to using it in the long term.
Thanks!
October 25, 2022 at 5:53 pm #2386492Fernando Customer Support
Yes, the CSS in the Customizer is stored in the database, and if you switch themes, those CSS should still be there.
However, it’s best practice to take a backup of your site before making major changes like these. Seldom, there can be server/database issues while making major changes which may break things.
October 25, 2022 at 9:39 pm #2386719Ian
Thanks for your insight Fernando. Understood.
October 25, 2022 at 10:14 pm #2386765Fernando Customer Support
You’re welcome Ian!
-
AuthorPosts
- You must be logged in to reply to this topic.