PX Forums demoYou are browsing as a visitor. Try it as: Member · Moderator · AdminOne click, no password. All changes are reset every night at 03:45 CET.
Skip to content

Where do I put custom CSS so that it survives theme updates?

Log in
Replies
6
Voices
7
Views
368
Last activity
Score 4
Lena Fischer Topic starter Member237 karma28 posts · Joined Dec 2026

I edited the theme's style.css and lost everything after the last update. What is the right place for my own changes?

Choose a reaction
Reply

Solution Go to post #3

Never edit the theme files themselves. Use a child theme or the Custom CSS box in Theme settings:

/* Theme settings > Custom CSS */
.site-header {
  background: #14213d;
}

The Custom CSS box is stored in the database, so updates do not touch it. For bigger changes, create a child theme with its own style.css.

6 answers

Score 8
Yuki Tanaka Member375 karma45 posts · Joined Dec 2026
Solution

Never edit the theme files themselves. Use a child theme or the Custom CSS box in Theme settings:

/* Theme settings > Custom CSS */
.site-header {
  background: #14213d;
}

The Custom CSS box is stored in the database, so updates do not touch it. For bigger changes, create a child theme with its own style.css.

Choose a reaction
Reply
  • Worked, but I had to log out and back in first.

    – Lena Fischer
Score 0
Daniel Reyes Expert876 karma52 posts · Joined Dec 2026

Can you post a screenshot of the settings page? Hard to tell otherwise.

Choose a reaction
Reply
Score 0
Hannah Lindqvist Moderator597 karma46 posts · Joined Dec 2026

@demo-lena ↗:

I edited the theme's style.css and lost everything after the last update. What is the right place for my own changes?

Did you try this on a fresh copy of the site? That would tell you whether it is the content or the setup.

Choose a reaction
Reply
Score 0
Kenji Watanabe Expert488 karma40 posts · Joined Dec 2026

Try this first, it is the most common cause:

php -v
php -m | grep -i mysqli
Choose a reaction
Reply
Score 0
Nora Bergström Member225 karma42 posts · Joined Dec 2026

Same issue here on a cheap shared plan. The host had to enable an extension for me.

Choose a reaction
Reply
Score 0
Tomáš Novák Moderator697 karma44 posts · Joined Dec 2026

Worked for me, thanks @demo-lena. I had been fighting this for two evenings.

Choose a reaction
Reply