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

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

New topic
Notifications

Notifications

View all notifications
Messages
Sam MemberAccount menu
Sam Member @member · 0 karma
My profile My topics Subscriptions Messages Settings
Replies
6
Voices
7
Views
367
Last activity
Subscribe
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
Quote
Report
Reply
Add a comment

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
Quote
Report
Reply
  • Worked, but I had to log out and back in first.

    – Lena Fischer
Add a comment
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
Quote
Report
Reply
Add a comment
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
Quote
Report
Reply
Add a comment
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
Quote
Report
Reply
Add a comment
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
Quote
Report
Reply
Add a comment
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
Quote
Report
Reply
Add a comment

Your reply

Cancel Markdown supported · Ctrl+Enter to send